:: phone_widgets[widget]

<<widget 'phoneConversation'>>
	<<set $conversationNpcID = _args[0]>>
	<<set _conversationPassage = _args[1]>>
	<div class="call conversation">
		<<image $npc(_callingNpcID).image>>
		<h2><<=$npc(_callingNpcID).fullname>></h2>
		<div id="phoneConversationBody">
			<<include _conversationPassage>>
		</div>
	</div>

<</widget>>

<<widget 'phoneConversationEnd'>>
	<<set _label = _args[0]>>
	<<link _label>>
		<<phoneOverlayRemove>>
	<</link>>
<</widget>>

<<widget "phoneCoversationOption" container>>
	<<set _label = _args[0]>>
	<<capture _contents>>
		<<link _label>>
			<<replace "#phoneConversationBody">>
				_contents
			<</replace>>
		<</link>>
	<</capture>>
<</widget>>

<<widget 'phoneMain'>>
	<<if !$phoneTheme>><<set $phoneTheme = 'Custom_Standard'>><</if>>
	<<set _iconFolder = 'system/phone/theme/'+$phoneTheme+'/'>>
	<<phoneOverlayAdd>>
		<<phoneMainMenu>>
	<</phoneOverlayAdd>>
<</widget>>

<<widget 'phoneMainMenu'>>
	<div id="mainMenu">
		<<linkedImage `_iconFolder+'icon_sms.png'`>>
			<<replace '#phonecontents'>>
				<<phoneSMSMenu>>
			<</replace>>
		<</linkedImage>>
		<<linkedImage `_iconFolder+'icon_calendar.png'`>>
		<</linkedImage>>
		<<linkedImage `_iconFolder+'icon_call.png'`>>
		<</linkedImage>>
		<<linkedImage `_iconFolder+'icon_camera.png'`>>
		<</linkedImage>>
		<<linkedImage `_iconFolder+'icon_megafon.png'`>>
		<</linkedImage>>
		<<linkedImage `_iconFolder+'icon_music.png'`>>
		<</linkedImage>>
		<<linkedImage `_iconFolder+'icon_notebook.png'`>>
		<</linkedImage>>
		<<linkedImage `_iconFolder+'icon_pictures.png'`>>
		<</linkedImage>>
		<<linkedImage `_iconFolder+'icon_settings.png'`>>
		<</linkedImage>>
		<<linkedImage `_iconFolder+'icon_weather.png'`>>
		<</linkedImage>>
	</div>
<</widget>>

<<widget 'phoneRing'>>
	<<set _callingNpcID = _args[0]>>
	<<set _callingTopic = _args[1]>>
	<<phoneOverlayAdd>>
		<div class="call incomming">
			<<image $npc(_callingNpcID).image>>
			<h2><<=$npc(_callingNpcID).fullname>></h2>
			<div class="answerButton">
				<<link "Answer">>
					<<replace "#phonecontents">>
						<<phoneConversation _callingNpcID _callingTopic>>
					<</replace>>
				<</link>>
			</div>
		</div>
	<</phoneOverlayAdd>>
<</widget>>

<<widget "phoneOverlayAdd" container>>
	<<done>>
		<<append "#passages">>
			<div id="phoneContainer">
				<div id="phone">
					<div id="head"><<time_current>><span id="signalStrength">📶</span></div>
					<div id="phonecontents">_contents</div>
				</div>
			</div>
		<</append>>

		<<timed 1s>>
			<<append "#phoneContainer">>
				<<link "">>
					<<phoneOverlayRemove>>
				<</link>>
			<</append>>
		<</timed>>
	<</done>>
<</widget>>

<<widget 'phoneOverlayRemove'>>
	<<remove "#phoneContainer">>
<</widget>>

<<widget 'phoneReceivePendingCall'>>
	<<set _callNpcs = []>>
	<<for _npcID range $npcs.datingNPCs>>
		<<set _npcNextDateExpected = $npc(_npcID).date.nextDateExpected>>
		<<if _npcNextDateExpected >= 0 and _npcNextDateExpected <= $time.daystart>>
			<<set _dayTheNPCWantsToCall = $time.daystart - _npcNextDateExpected>>
			<<set _weight = Math.pow(_dayTheNPCWantsToCall + 1 , 2)>>
			<<run _callNpcs.push({
				npcId: _npcID,
				weight: _weight,
				topic: 'boyfriendPhoneIncomming'
			})>>
		<</if>>

	<</for>>

	<<if _callNpcs.length > 0>>
		<<set _callData = _callNpcs.getRandomWeighted()>>
		<<run console.log('Phone',_callNpcs,_callData)>>
		<<phoneRing _callData.npcId _callData.topic>>
	<</if>>
<</widget>>

<<widget 'phoneSMSMenu'>>
	<<if !$phone.hasSms>>
		<p>You don't have any messages.</p>
	<<else>>
		<div id="smsSenderOverview">
			<<for _npcId range $phone.smsContacts>>
				<<set _styleClass = "sender">>
				<<if $phone.smsHasNew(_npcId)>>
					<<set _styleClass += " hasNew">>
				<</if>>
				<div @class=_styleClass>
					<<image $npc(_npcId).image>>
					<div class="nickname"><<=$npc(_npcId).usedname>></div>
					<<capture _npcId>>
						<<link "">>
							<<replace "#phonecontents">>
								<<smsShow _npcId>>
							<</replace>>
						<</link>>
					<</capture>>
				</div>
			<</for>>
		</div>
	<</if>>
<</widget>>

<<widget 'smsSend'>>
	<<set _sms_npcId 		= _args[0]>>
	<<set _sms_datetime 	= _args[1]>>
	<<set _sms_bodyPassage	= _args[2]>>

	/*<<set $sms ??= {}>>
	<<set $sms[_sms_npcId] ??= {messages:[],unread:0}>>

	<<set _message = {time:_sms_datetime,body:_sms_bodyPassage, seed: rand(0,999999)}>>
	<<run $sms[_sms_npcId].messages.push(_message)>>
	<<set $sms[_sms_npcId].unread += 1>>
	<<run console.log('SMS generated',_sms_npcId,_message)>>*/
	<<run $phone.smsCreate(_sms_npcId,_sms_datetime,_sms_bodyPassage)>>
<</widget>>

<<widget 'smsShow'>>
	<<set _sms_npc_id = _args[0]>>
	<!-- <<set _sms = $sms[_sms_npc_id].messages.toReversed()>> -->
	/*<<set _sms = $sms[_sms_npc_id].messages>>*/
	<<set _sms = $phone.smsBySender(_sms_npc_id)>>
	<<for _sm range _sms>>
		<div class="sms">
			<div class="messageBody">
				<<set _messageData = _sm.data ?? {}>>
				<<randomSeed _sm.seed>>
					<!-- Use seed to make sure that a message that contains random elements will always stay the same. -->
					<<include _sm.body>>
				<</randomSeed>>
			</div>
			<div class="time"><<time_print _sm.time>></div>
		</div>
	<</for>>
	<<run $phone.smsSetRead(_sms_npc_id)>>
<</widget>>

:: telefon[deprecated]

<<info "Deactivated: telefon">>
:: telefon_deactivated
/*
<!-- !2021/05/06-->
<!-- !! Draw screens for mobile phone.-->
<!-- !!-->
<!-- !! The base storage for Contacts is controlled by the Array "$contact". This array is a list of NPC identifiers-->
<!-- !! telling us which ones are in your contact list. There are several other ancillary arrays that support the functions-->
<!-- !! of a contact. Each of these has matching indexes to the $contact array. These are mostly used internally, but a-->
<!-- !! writer can make use of them if they need to.-->
<!-- !!-->
<!-- !! ContactList arrays:-->
<!-- !! $contact[]     = NPC code for contact. ('A129', 'A29', 'B13', 'C14')-->
<!-- !! $contactIcon[] = Icon for the contact to use. If path is left off, standard phone icon folder is used. if file extension is left off, '.png' is used-->
<!-- !! $contactOCode[] = Code to execute if call is placed to this contact-->
<!-- !! $contactOSche[] = If statement code to determine schedule for outbound calls-->
<!-- !! $contactICode[] = Code to execute for Incoming call-->
<!-- !! $contactISche[] = if statement code for schedule of incoming calls-->
<!-- !! contactAnon[] = 0 if contact number is known to Sveta, 1 for Anonymous-->
<!-- !! contactToday[] = Calls from this contact today-->
<!-- !! contactWeek[] = Calls from this contact this week-->
<!-- !! contactLastCall[] = last time this Contact called-->
<!-- !-->
<!-- !! Add a contact with AddContact-->
<!-- !!	gs 'telefon', 'AddContact', <NPC Code>, <Icon for NPC>, <Code for Incoming Call>, <Limiter for Incoming Call>, <Code for Outgoing Call>, <Limiter for Outgoign Call>, <Anonymous=1>-->
<!-- !!  Example, to Add Mother:-->
<!-- !!	gs 'telefon', 'AddContact', 'A29', 'icon_npc1', "gs 'telefon', 'Phone_call'", "hour >= 8 and hour <= 20", "gs 'telefon', 'lover'", "hour >= 8 and hour <= 20", 0-->
<!-- !!-->
<!-- !! Remove a contact with DeleteContact-->
<!-- !!	gs 'telefon', 'DeleteContact', <NPC Code>-->
<!-- !!  Example, to delete Mom:-->
<!-- !!	gs 'telefon', 'DeleteContact', 'A29'-->
<!-- !!-->
<!-- !! Header for Phone Screen.  Keeps consistent and in one place-->
<!-- !! Footer for phone screen.  Body should be between these two-->
<!-- !! ''''This is how we print the screen on to the Additional Dscription window-->
<!-- !! This is the formatting function for a row in the Contact List. SHould be run as a DYNEVAL()-->
<<if $location_var[$here][0] == 'AddContact'>>
	<!-- !! $ARGS[1] = NPC Array identifier-->
	<!-- !! $ARGS[2] = Icon-->
	<!-- !! $ARGS[3] = Code to execute for Call out-->
	<!-- !! $ARGS[4] = If statement code to determine schedule for outbound calls-->
	<!-- !! $ARGS[5] = Code to execute for Incoming call-->
	<!-- !! $ARGS[6] = if statement code for schedule of incoming calls-->
	<!-- !!  ARGS[7] = Anonymous? 0 if not, 1 if yes-->
	<<setinit $telefonCon['NPC'] = $location_var[$here][1]>>
	<<setinit $telefonCon['Icon'] = $location_var[$here][2]>>
	<<setinit $telefonCon['OutCode'] = $location_var[$here][3]>>
	<<setinit $telefonCon['OutSched'] = $location_var[$here][4]>>
	<<setinit $telefonCon['InCode'] = $location_var[$here][5]>>
	<<setinit $telefonCon['InSched'] = $location_var[$here][6]>>
	<<setinit $telefonCon['Anonymous'] = $ARGS[7]>>
	<<setinit $telefonCon['ContactListID'] = arrpos('$contact',$telefonCon['NPC'])>>
	<<if getvar("$telefonCon['ContactListID']") == -1>>
		<<setinit $telefonCon['ContactListID'] = arrsize('$contact')>>
		<<setinit $contact[$telefonCon['ContactListID']] = $telefonCon['NPC']>>
	<</if>>
	<<setinit $contactIcon[$telefonCon['ContactListID']] = $telefonCon['Icon']>>
	<<setinit $contactOCode[$telefonCon['ContactListID']] = $telefonCon['OutCode']>>
	<<setinit $contactOSche[$telefonCon['ContactListID']] = $telefonCon['OutSched']>>
	<<setinit $contactICode[$telefonCon['ContactListID']] = $telefonCon['InCode']>>
	<<setinit $contactISche[$telefonCon['ContactListID']] = $telefonCon['InSched']>>
	<<setinit $contactAnon[$telefonCon['ContactListID']] = $telefonCon['Anonymous']>>
	<<set $telefonCon to null>>
	<<set $telefonCon to null>>
<</if>>
<<if $location_var[$here][0] == 'DeleteContact'>>
	<!-- !! $ARGS[1] = NPC Array identifier-->
	<<setinit $telefonCon['NPC'] = $location_var[$here][1]>>
	<<setinit $telefonCon['ContactListID'] = arrpos('$contact',$telefonCon['NPC'])>>
	<<if getvar("$telefonCon['ContactListID']") > -1>>
		<<set $contact[$telefonCon['ContactListID']] to null>>
		<<set $contactIcon[$telefonCon['ContactListID']] to null>>
		<<set $contactCode[$telefonCon['ContactListID']] to null>>
	<</if>>
	<<set $telefonCon to null>>
	<<set $telefonCon to null>>
<</if>>
<<if $location_var[$here][0] == 'ContactList'>>
	<<setinit $telefon['body'] = >>
	<font size=6>Contacts</font><br>
	<img src="images/system/phone/theme/<<$phonetheme_name[$pcs_phonetheme]>>/icon_call.png" height="80" width="80"><br><br>
	<!-- FAILED TO CONVERT
		<TABLE cellspacing="0" width="80%">'
	-----
		<<set ERROR: FAILED TO CONVERT LITERAL: """<TABLE cellspacing""" = ERROR: FAILED TO CONVERT LITERAL: """"0" width="80""" % ERROR: FAILED TO CONVERT LITERAL: """">'""">>

	-->
	<<warn "CONVERSION ERROR 6061d446a950b4869623028a78c479f5">>
	<!-- !!iterating all Contacts-->
	<<set $i = 0>>
	<<warn 'JUMP MARKER ENCOUNTERED: :contactloop2'>>
	<<if $i < arrsize('$contact')>>
		<<if getvar("$contactAnon["+$i+"]") == 0>>
			<<setinit $telefon['body'] += dyneval($telefon['contact'],$contactIcon[$i],$npc($contact[$i).nickname],$contactOCode[$i],$contactOSche[$i])>>
		<</if>>
		<<set $i += 1>>
		<<warn 'JUMP COMMAND ENCOUNTERED: jump contactloop2'>>
	<</if>>
	<!-- !! Oddball Contacts-->
	<<if getvar("$telalla") > 0>>
		<!-- FAILED TO CONVERT
			$telefon['body'] += dyneval($telefon['contact'],'icon_ira1','Alla',"$telsob = 'Alla' & gt 'telefon', 'mobilaraz'","hour >= 8 and hour <= 20")
		-----
			<<setinit $telefon['body'] += dyneval($telefon['contact'],'icon_ira1','Alla',"$telsob = 'Alla'>> <<set gt 'telefon' , 'mobilaraz'" , ERROR: FAILED TO CONVERT LITERAL: """"hour >""" = 8 and hour <= 20")>>

		-->
		<<warn "CONVERSION ERROR ccf3b4e0d1f785904385534b4daa3100">>
	<</if>>
	<<if getvar("$telmasha") > 0>>
		<!-- FAILED TO CONVERT
			$telefon['body'] += dyneval($telefon['contact'],'icon_masha','Masha',"$telsob = 'Masha' & gt 'telefon', 'mobilaraz'","hour >= 8 and hour <= 20")
		-----
			<<setinit $telefon['body'] += dyneval($telefon['contact'],'icon_masha','Masha',"$telsob = 'Masha'>> <<set gt 'telefon' , 'mobilaraz'" , ERROR: FAILED TO CONVERT LITERAL: """"hour >""" = 8 and hour <= 20")>>

		-->
		<<warn "CONVERSION ERROR 46b55441aa048469706a8d74d2e89a03">>
	<</if>>
	<!-- !! iterating all lovers-->
	<<set $lover_number = 0>>
	<<warn 'JUMP MARKER ENCOUNTERED: :loverloop2'>>
	<<if getvar("$pcs_lovers["+$lover_number+"]") == 1 and getvar("$svidanie["+$lover_number+"]") == 0>>
		<!-- FAILED TO CONVERT
			$telefon['body'] += dyneval($telefon['contact'],'icon_bf'+lover_picture[lover_number],$loverdesc[lover_number],"lover_number = <<lover_number>> & gt 'telefon', 'callingTheLover', <<lover_number>>","hour > 6 and hour < 20")
		-----
			<<setinit $telefon['body'] += dyneval($telefon['contact'],'icon_bf'+lover_picture[$lover_number],$loverdesc[$lover_number],"lover_number = <<lover_number>>>> <<gt 'telefon' 'callingTheLover' ERROR: FAILED TO CONVERT LITERAL: """<<lover_number>>"""" "hour > 6 and hour < 20")>>

		-->
		<<warn "CONVERSION ERROR dbf7fe231ad912237b6aa866ea279eeb">>
	<</if>>
	<<set $lover_number += 1>>
	<<if $lover_number < arrsize('pcs_lovers')>>
		<<warn 'JUMP COMMAND ENCOUNTERED: jump loverloop2'>>

	<</if>>
	<<setinit $telefon['body'] += '</TABLE><br>'>>
	<<telefon['print']>>
	<<set $i to null>>
	<<set $lover_number to null>>
<</if>>
<!-- !! Reset Contact Call Stats Daily and Weekly-->
<!-- !!-->
<!-- !! ARGS[1] = New Week if 1, 0 if same week-->
<<if $location_var[$here][0] == 'DailyStatRefresh'>>
	<<set $i = 0>>
	<<warn 'JUMP MARKER ENCOUNTERED: :DailyStatRefLoop'>>
	<<if $i < arrsize('$contact')>>
		<<setinit $contactToday[$i] = 0>>
		<<if $location_var[$here][1] == 1>>
			<<setinit $contactWeek[$i] = 0>>
		<</if>>
		<<set $i += 1>>
		<<warn 'JUMP COMMAND ENCOUNTERED: jump DailyStatRefLoop'>>
	<</if>>
	<<set $i to null>>
<</if>>
<!-- !! Determine if any Incoming calls should happen-->
<!-- !!-->
<!-- !!	ARGS[1] = Previous totminut-->
<!-- !!	ARGS[2] = Current totminut-->
<<if $location_var[$here][0] == 'IncomingCheck'>>
	<<setinit $telefIncCheck['PrevTotalMinutes'] = $ARGS[1]>>
	<<setinit $telefIncCheck['NewTotalMinutes'] = $ARGS[2]>>
	<<if $telefIncCheck['PrevTotalMinutes'] > $telefIncCheck['NewTotalMinutes'] or $telefon['LastIncCallCheck'] > $telefIncCheck['NewTotalMinutes'] or getvar("$telefon['LastIncCallCheck']") == 0>>
		<!-- !! Time Cheat has been used, so we should do some cleanup-->
		<<setinit $telefon['LastIncCallCheck'] = $telefIncCheck['NewTotalMinutes']>>
	<</if>>
	<!-- !! Limit the number of calls per day-->
	<!-- !! right now allow every 60 minutes-->
	<<if $telefIncCheck['NewTotalMinutes'] - getvar("$telefon['LastIncCallCheck']") > 60 and getvar("$menu_off") == 0 and getvar("$phone_off") == 0>>
		<<setinit $telefon['LastIncCallCheck'] = $telefIncCheck['NewTotalMinutes']>>
		<<gs 'telefon' 'IncomingCallChooser'>>
	<</if>>
	<<set $telefIncCheck to null>>
<</if>>
<<if $location_var[$here][0] == 'IncomingCallChooser'>>
	<!-- !! When an Incoming call happens, choose who it comes from-->
	<!-- !! Add Contacts-->
	<<set $i = 0>>
	<<warn 'JUMP MARKER ENCOUNTERED: :telefonIncLoop1'>>
	<<if $i < arrsize('$contact')>>
		<<if $contactICode[$i] != "">>
			<<if dyneval('$result = iif(<<$contactISche[$i]>>,1,0)') = 1>>
				<<set $j = arrsize('$telefIncCall')>>
				<<if getvar("$contactAnon["+$i+"]") == 1>>
					<<setinit $telefIncIcon[$j] = "images/system/phone/decline.png">>
					<<setinit $telefIncName[$j] = "Unknown Caller">>
				<<else>>
					<<setinit $telefIncIcon[$j] = $contactIcon[$i]>>
					<<setinit $telefIncName[$j] = $npc($contact[$i).nickname]>>
				<</if>>
				<<setinit $telefIncCall[$j] = $contactICode[$i]>>
				<<setinit $telefIncNPC[$j] = $contact[$i]>>
			<</if>>
		<</if>>
		<<set $i += 1>>
		<<warn 'JUMP COMMAND ENCOUNTERED: jump telefonIncLoop1'>>
	<</if>>
	<!-- !! Add Lovers-->
	<<set $i = 0>>
	<<warn 'JUMP MARKER ENCOUNTERED: :telefonIncLoop2'>>
	<<if getvar("$i") < 3 and $time.hour > 5 and $time.hour < 20>>
		<<if getvar("$pcs_lovers["+$i+"]") == 1 and getvar("$svidanie["+$i+"]") == 0 and $loverday[$i] != $time.daystart and rand(1,100) > 95>>
			<<set $j = arrsize('$telefIncCall')>>
			<!-- FAILED TO CONVERT
				$telefIncCall[j] = "cls & gs 'telefon', 'lover', <<i>>"
			-----
				<<setinit $telefIncCall[$j] = "cls>> <<gs 'telefon' 'lover' ERROR: FAILED TO CONVERT LITERAL: """<<i>>"""">>

			-->
			<<warn "CONVERSION ERROR 2fd82560cc77d708040d80eab4c492b0">>
			<<setinit $telefIncIcon[$j] = 'images/characters/shared/headshots_generic/lover_picture[$i].jpg'>>
			<<setinit $telefIncName[$j] = $loverdesc[$i]>>
		<</if>>
		<<set $i += 1>>
		<<warn 'JUMP COMMAND ENCOUNTERED: jump telefonIncLoop2'>>
	<</if>>
	<<if arrsize('$telefIncCall') > 0>>
		<<set $j = rand(0,arrsize('$telefIncCall')-1)>>
		<<if $telefIncNPC[$j] != "">>
			<<set $i = arrpos('$contact',$telefIncNPC[$j])>>
			<<setinit $contactLastCall[$i] = $totminut>>
			<<setinit $contactToday[$i] += 1>>
			<<setinit $contactWeek[$i] += 1>>
		<</if>>
		<<gs 'telefon' 'IncomingCall' $telefIncIcon[$j] $telefIncName[$j] $telefIncCall[$j]>>
	<</if>>
	<<set $i to null>>
	<<set $j to null>>
	<<set $telefIncIcon to null>>
	<<set $telefIncName to null>>
	<<set $telefIncCall to null>>
	<<set $telefIncNPC to null>>
<</if>>
<<if $location_var[$here][0] == 'IncomingCall'>>
	<!-- !! $ARGS[1] = Icon for contact-->
	<!-- !! $ARGS[2] = Nickname of contact-->
	<!-- !! $ARGS[3] = Code to execute for this Call-->
	<<setinit $telefonIncC['Icon'] = $location_var[$here][1]>>
	<<setinit $telefonIncC['Name'] = $location_var[$here][2]>>
	<<setinit $telefonIncC['Code'] = $location_var[$here][3]>>
	<<setinit $telefon['body'] = >>
	<font size=6><<$telefonIncC["Name"]>> calling</font><br>
	<img src="<<$telefonIncC["Icon"]>>" width="200"><br>
	<br>
	<br>
	<br>
	<a href="exec:<<$telefonIncC["Code"]>>"><<image 'images/system/phone/call_accept.png'>></a>
	<a href="exec:gt $loc, $loc_arg"><<image 'images/system/phone/decline.png'>></a><br>
	<!-- FAILED TO CONVERT
		<b><font color="red">Your phone is ringing</font></b><br>'
	-----
		<<set ERROR: FAILED TO CONVERT LITERAL: """<b><font color""" = ERROR: FAILED TO CONVERT LITERAL: """"red">Your phone is ringing<""" / ERROR: FAILED TO CONVERT LITERAL: """font><""" / ERROR: FAILED TO CONVERT LITERAL: """b><br>'""">>

	-->
	<<warn "CONVERSION ERROR 6df1f9d9d669df4415284b2dc86e89df">>
	<<telefon['print']>>
	<<set $telefonIncC to null>>
<</if>>
<!-- !----------------------------------------------------------------------------------------->
<!-- ! Generic Calls for dates-->
<!-- !! NPC Date-->
<!-- !!	ARGS[1] = contactlist index-->
<!-- !!	$ARGS[2] = Date Location-->
<<if $location_var[$here][0] == 'NPCDate'>>
	<<setinit $Call4Date["ContactIndex"] = $ARGS[1]>>
	<<setinit $Call4Date["Location"] = $location_var[$here][2]>>
	<<setinit $Call4Date["NPC"] = $contact[$Call4Date['ContactIndex']]>>
	<<setinit $Call4Date["CallerName"] = $npc($Call4Date["NPC").nickname]>>
	<!-- !! These variables are setup for certain downstream functions-->
	<<set $caller = $Call4Date["CallerName"]>>
	<<set $callerid = $contactIcon[$Call4Date["ContactIndex"]]>>
	<<set $boydesc = $Call4Date["CallerName"]>>
	<<set $pc.mood += 10>>
	<<setinit $npc($Call4Date["NPC").rel] += 3>>
	<<if $Call4Date["Location"] == 'city_park'>>
		<<if $npc($Call4Date["NPC").gender] == 0>>
			<<gt 'dateM' 'datepark'>>
		<<else>>
			<<gt 'dateF' 'datepark'>>
		<</if>>
	<<elseif $Call4Date["Location"] == 'movie'>>
		<<if $npc($Call4Date["NPC").gender] == 0>>
			<<gt 'dateM' 'datecinema'>>
		<<else>>
			<!-- !Not implemented yet-->
			<!-- !gt 'dateF','datecinema'-->
		<</if>>
	<<elseif $Call4Date["Location"] == 'bar'>>
		<<if $npc($Call4Date["NPC").gender] == 0>>
			<<gt 'dateM' 'datebar'>>
		<<else>>
			<<gt 'dateF' 'datebar'>>
		<</if>>
	<<elseif $Call4Date["Location"] == 'cafe'>>
		<<if $npc($Call4Date["NPC").gender] == 0>>
			<<gt 'dateM' 'datecafe'>>
		<<else>>
			<!-- !Not implemented yet-->
			<!-- !gt 'dateF','datecafe'-->
		<</if>>
	<</if>>
	<<set $Call4Date to null>>
	<<set $Call4Date to null>>
<</if>>
<!-- !! Sveta Calls the NPC-->
<!-- !!	ARGS[1] = contactlist index-->
<<if $location_var[$here][0] == 'SvetaCallsNPC'>>
	<<setinit $Call4Date["ContactIndex"] = $ARGS[1]>>
	<<setinit $Call4Date["NPC"] = $contact[$Call4Date['ContactIndex']]>>
	<<setinit $Call4Date["CallerName"] = $npc($Call4Date["NPC").nickname]>>
	<<if $npc($Call4Date["NPC").gender] == 0>>
		<<setinit $Call4Date["NPC-he"] = 'he'>>
		<<setinit $Call4Date["NPC-He"] = 'He'>>
		<<setinit $Call4Date["NPC-his"] = 'his'>>
		<<setinit $Call4Date["NPC-His"] = 'His'>>
	<<else>>
		<<setinit $Call4Date["NPC-he"] = 'her'>>
		<<setinit $Call4Date["NPC-He"] = 'Her'>>
		<<setinit $Call4Date["NPC-his"] = 'hers'>>
		<<setinit $Call4Date["NPC-His"] = 'Hers'>>
	<</if>>
	<!-- !! These variables are setup for certain downstream functions-->
	<<set $caller = $Call4Date["CallerName"]>>
	<<set $callerid = $contactIcon[$Call4Date["ContactIndex"]]>>
	<<gs 'telefon' 'phone_balance'>>
	<<gs 'telefon' 'phone_call_receive'>>
	<<setinit $Call4Date["willAgree"] = (rand(0, 10) > 3)>>
	"Yes, I'm listening," says a voice from the speaker.
	<<actCLA 'Ask to meet'>>
		"Let''s meet up."
		<<actCLA 'Continue'>>
			<<gt 'telefon' 'NPCCallsForDate' $Call4Date["ContactIndex"]>>
		<</actCLA>>
	<</actCLA>>
	<<if $time.month > 5 and $weather.temperature > 20 and !$weather.isRaining>>
		<<actCLA 'Invite to the park'>>
			"Let''s go for a walk in the park."
			<<if $Call4Date["willAgree"]>>
				<p>$Call4Date["CallerName"], "See you in the park in an hour."</p>
				<<actCLA 'Go'>>
					<<gt 'telefon' 'NPCDate' $Call4Date["ContactIndex"] 'city_park'>>
				<</actCLA>>
			<<else>>
				<<gs 'telefon' 'telotkaz' $Call4Date["CallerName"]>>
			<</if>>
		<</actCLA>>
	<</if>>
	<<actCLA 'Invite to a movie'>>
		<p>"Want to go see a movie?"</p>
		<<if $Call4Date["willAgree"]>>
			<p>$Call4Date["CallerName"], "See you at the movie theater in an hour."</p>
			<<actCLA 'Go'>>
				<<gt 'telefon' 'NPCDate' $Call4Date["ContactIndex"] 'movie'>>
			<</actCLA>>
		<<else>>
			<<gs 'telefon' 'telotkaz' $Call4Date["CallerName"]>>
		<</if>>
	<</actCLA>>
	<<if $home['town'] == 'city'>>
		<<actCLA 'Invite to the bar'>>
			"Let''s go to the bar."
			<<if $Call4Date["willAgree"]>>
				<p>$Call4Date["CallerName"], "See you at the bar in an hour."</p>
				<<actCLA 'Go'>>
					<<gt 'telefon' 'NPCDate' $Call4Date["ContactIndex"] 'bar'>>
				<</actCLA>>
			<<else>>
				<<gs 'telefon' 'telotkaz' $Call4Date["CallerName"]>>
			<</if>>
		<</actCLA>>
	<</if>>
	<<actCLA 'Invite to the cafe'>>
		"Let''s go to the cafe."
		<<if $Call4Date["willAgree"]>>
			<p>$Call4Date["CallerName"], "See you at the cafe in an hour."</p>
			<<actCLA 'Go'>>
				<<gt 'telefon' 'NPCDate' $Call4Date["ContactIndex"] 'cafe'>>
			<</actCLA>>
		<<else>>
			<<gs 'telefon' 'telotkaz' $Call4Date["CallerName"]>>
		<</if>>
	<</actCLA>>
	<!-- !!Willpower checks for resistance-->
	<<if $npc($Call4Date["NPC").rel] <= 25>>
		<<setinit $Call4Date["loverResist"] = 'easy'>>
	<<elseif $npc($Call4Date["NPC").rel] <= 50>>
		<<setinit $Call4Date["loverResist"] = 'medium'>>
	<<else>>
		<<setinit $Call4Date["loverResist"] = 'hard'>>
	<</if>>
	<<gs 'willpower' 'misc' 'self' $Call4Date["loverResist"]>>
	<<if $will_cost <= $pc.pcs_willpwr>>
		<<actCLA 'I think we should break up... (will_cost Willpower)'>>
			<<gs 'willpower' 'pay' 'self'>>
			<p>$Call4Date["NPC-He"] sounds hurt, but you insist it is for the best. You both say goodbye and part ways.</p>
			<<gs 'telefon' 'DeleteContact' $Call4Date["NPC"]>>
			<<act 'Hang up'>>
				<<gt 'telefon' 'fin'>>
			<</act>>
		<</actCLA>>
	<<else>>
		<<actCLA 'I think we should break up... (<font color="red">will_cost Willpower</font>)'>>
			<br><font color="red">You don't have enough willpower to use this action.</font>
		<</actCLA>>
	<</if>>
	<<act 'Hangup'>>
		<<gt 'telefon' 'fin'>>
	<</act>>
	<<set $Call4Date to null>>
	<<set $Call4Date to null>>
	<<set $DateNickName to null>>
<</if>>
<!-- !! NPC Calls Sveta for a Date-->
<!-- !!	ARGS[1] = $contact index number-->
<<if $location_var[$here][0] == 'NPCCallsForDate'>>
	<<setinit $Call4Date["ContactIndex"] = $ARGS[1]>>
	<<setinit $Call4Date["NPC"] = $contact[$Call4Date['ContactIndex']]>>
	<<if $npc($Call4Date["NPC").gender] == 0>>
		<<setinit $Call4Date["NPC-he"] = 'he'>>
		<<setinit $Call4Date["NPC-He"] = 'He'>>
		<<setinit $Call4Date["NPC-his"] = 'his'>>
		<<setinit $Call4Date["NPC-His"] = 'His'>>
	<<else>>
		<<setinit $Call4Date["NPC-he"] = 'her'>>
		<<setinit $Call4Date["NPC-He"] = 'Her'>>
		<<setinit $Call4Date["NPC-his"] = 'hers'>>
		<<setinit $Call4Date["NPC-His"] = 'Hers'>>
	<</if>>
	<!-- !!Pick a nickname that caller will use for Sveta-->
	<<setinit $DateNickName[0] = 'cutie'>>
	<<setinit $DateNickName[1] = 'honey'>>
	<<setinit $DateNickName[2] = 'sweetie'>>
	<<setinit $DateNickName[3] = 'baby'>>
	<<setinit $DateNickName[4] = 'hot stuff'>>
	<<setinit $DateNickName[5] = '$pc.name_nick'>>
	<<setinit $Call4Date['SvetaName'] = $DateNickName[rand(0, arrsize('$DateNickName'))]>>
	<<setinit $Call4Date['CallerName'] = $npc($Call4Date["NPC").nickname]>>
	<!-- !! These variables are setup for certain downstream functions-->
	<<set $caller = $Call4Date["CallerName"]>>
	<<set $callerid = $contactIcon[$Call4Date["ContactIndex"]]>>
	<p>Hey $Call4Date["SvetaName"], it's me, $Call4Date["CallerName"]. How's it going?</p>
	<<actCLA 'Answer'>>
		<p>"Pretty good, you?"</p>
		<p>$Call4Date["CallerName"], "Great, but I kind of miss you, can we meet today?"</p>
		<<if $time.weekday > 1 and $time.weekday < 5 and getvar("$workKafe['job']") == 1>>
			<<actCLA 'Sorry, I`m working today'>>
				"Sorry, I'm working today."
				<p>$Call4Date["CallerName"], "Okay, I'll call tomorrow."</p>
				<<act 'Hang up'>>
					<<gt 'telefon' 'fin'>>
				<</act>>
			<</actCLA>>
		<</if>>
		<<actCLA 'Tonight'>>
			<<setinit $npc($Call4Date["NPC").rel] += 1>>
			<<setinit $contMeetDay[$Call4Date["ContactIndex"]] = $time.daystart>>
			<p>"How about this evening?"</p>
			<p>$Call4Date["CallerName"], "Sounds great! When can I come to pick you up?"</p>
			<<actCLA 'Pick a time'>>
				<<setinit $contMeetHour[$Call4Date["ContactIndex"]] = input ("When do you want to be picked up. It is now <<$mid(100+hour,2,2)>>:<<$mid(100+minut,2,2)>>. [Enter the hour only 0 - 20]")>>
				<<if $contMeetHour[$Call4Date["ContactIndex"]] <= $time.hour or $contMeetHour[$Call4Date["ContactIndex"]] > 23>>
					<<setinit $contMeetHour[$Call4Date["ContactIndex"]] = 20>>

				<</if>>
				<p>"How about contMeetHour[$Call4Date["ContactIndex"]]:00?."</p>
				<p>$Call4Date["CallerName"], "Okay $Call4Date["SvetaName"], see you at contMeetHour[$Call4Date["ContactIndex"]]:00."</p>
				<<act 'Hang up'>>
					<<gt 'telefon' 'fin'>>
				<</act>>
			<</actCLA>>
		<</actCLA>>
		<<actCLA 'Maybe tomorrow'>>
			<<setinit $npc($Call4Date["NPC").rel] -= 1>>
			"I'm busy today. Call tomorrow."
			<<if $npc($Call4Date["NPC").rel] <= 0>>
				 <<gs 'telefon' 'DeleteContact' $Call4Date["NPC"]>>

			<</if>>
			<<if $npc($Call4Date["NPC").rel] > 0>>
				<p>($Call4Date["CallerName"]) -  Okay, I'll call tomorrow.</p>

			<</if>>
			<<act 'Hang up'>>
				<<gt 'telefon' 'fin'>>
			<</act>>
		<</actCLA>>
		<!-- !!Willpower checks for resistance-->
		<<if $npc($Call4Date["NPC").rel] <= 25>>
			<<setinit $Call4Date["loverResist"] = 'easy'>>
		<<elseif $npc($Call4Date["NPC").rel] <= 50>>
			<<setinit $Call4Date["loverResist"] = 'medium'>>
		<<else>>
			<<setinit $Call4Date["loverResist"] = 'hard'>>
		<</if>>
		<<gs 'willpower' 'misc' 'self' $Call4Date["loverResist"]>>
		<<if $will_cost <= $pc.pcs_willpwr>>
			<<actCLA 'I think we should break up... (will_cost Willpower)'>>
				<<gs 'willpower' 'pay' 'self'>>
				<p>$Call4Date["NPC-He"] sounds hurt, but you insist it is for the best. You both say goodbye and part ways.</p>
				<<gs 'telefon' 'DeleteContact' $Call4Date["NPC"]>>
				<<act 'Hang up'>>
					<<gt 'telefon' 'fin'>>
				<</act>>
			<</actCLA>>
		<<else>>
			<<actCLA 'I think we should break up... (<font color="red">will_cost Willpower</font>)'>>
				<br><font color="red">You don't have enough willpower to use this action.</font>
			<</actCLA>>
		<</if>>
	<</actCLA>>
	<<actCLA 'Hang up (end relationship)'>>
		<<gs 'telefon' 'DeleteContact' $Call4Date["NPC"]>>
		<<gt 'telefon' 'fin'>>
	<</actCLA>>
	<<set $Call4Date to null>>
	<<set $Call4Date to null>>
	<<set $DateNickName to null>>
<</if>>
<<if $location_var[$here][0] == 'start'>>
	<<gs 'telefon' 'phone_call_receive'>>
	<<if $npc('A192').QW == 1 and $time.weekday == 6 and $pc.pcs_apprnc > 80>>
		<<gt 'nastja' 'pos4'>>
	<<elseif $npc('A192').QW == 2 and $time.weekday != 6 and getvar("$zenit") != 0 and $nastjaday != $time.daystart>>
		<<gt 'nastja' 'pos13'>>
	<<elseif $time.hour >= 8 and $time.hour <= 20 and $npc('A192').QW == 2 and $time.weekday == 6 and $pc.pcs_apprnc > 80 and $nastjaday != $time.daystart>>
		<<gt 'nastja' 'pos12'>>
	<<elseif $npc('A192').QW == 5 and $time.weekday == 6 and $nastjaday != $time.daystart>>
		<<gt 'nastja' 'pos22'>>
	<<elseif $npc('A192').QW == 6 and $nastjaday != $time.daystart>>
		<<gt 'nastja' 'pos31'>>
	<<else>>
		<<set $callerid = 'images/system/phone/icons/icon_nastja.png'>>
		<<gs 'telefon' 'phone_call_reject'>>
	<</if>>
<</if>>
<<if $location_var[$here][0] == 'vladimir'>>
	<<gs 'telefon' 'phone_ring'>>
	<<if getvar("$vladimirQW") == 20>>
		<<gt 'qwloc' '2'>>
	<<elseif getvar("$vladimirQW") == 25 and $time.weekday == 6>>
		<<gt 'qwloc' '3'>>
	<<elseif getvar("$vladimirQW") == 35 and $time.weekday == 6>>
		<<gt 'qwloc' '4'>>
	<</if>>
<</if>>
<!-- !---------------------------------------------------------------------------------------------------->
<!-- ! Old telephone system.  Some of this should be removed.-->
<<if $location_var[$here][0] == 'phone_ring'>>
	<<setinit $telefon['body'] = >>
	<font size=6><<$caller>> calling</font><br>
	<img src="<<$callerid>>"><br>
	<br>
	<br>
	<br>
	<!-- FAILED TO CONVERT
		<br>'
	-----
		ERROR: FAILED TO CONVERT LITERAL: """<br>'"""

	-->
	<<warn "CONVERSION ERROR 2f34f4dd8a4cc48f5c842ae3accadd22">>
	<<telefon['print']>>
<</if>>
<<if $location_var[$here][0] == 'phone_call_receive'>>
	<<setinit $telefon['body'] = >>
	<font size=6>Talking to <<$caller>></font><br>
	<!-- FAILED TO CONVERT
		<img src="<<$callerid>>"><br>'
	-----
		<<set ERROR: FAILED TO CONVERT LITERAL: """<img src""" = ERROR: FAILED TO CONVERT LITERAL: """"$callerid"><br>'""">>

	-->
	<<warn "CONVERSION ERROR 59bf1f27edbb9644cce526bde6a21ae3">>
	<<telefon['print']>>
<</if>>
<<if $location_var[$here][0] == 'phone_balance'>>
	<<if getvar("$subscription['monthly_calls']") == 0 and getvar("$subscription['metered_calls']") < 4>>
		<<if getvar("$subscription['monthly_calls']") == 0 and $subscription['monthly_calls-date'] > 0>>
			<<set $contractmessage = '<font size=6>Your mobile contract has expired, you have renew it or buy some minutes.</font><br>'>>
		<<elseif getvar("$subscription['metered_calls']") < 4 and $subscription['metered_calls-date'] > 0>>
			<<set $contractmessage = '<font size=6>Not enough minutes left on your contract to make a call</font><br>'>>
		<<else>>
			<<set $contractmessage = '<font size=6>You don't have a valid contract, you should buy one at MegFon.</font><br>'>>
		<</if>>
		<<setinit $telefon['body'] = >>
		<<$contractmessage>>
		<img src="<<$callerid>>"><br><br>
		<!-- FAILED TO CONVERT
			<a href="exec:gs ''telefon'', ''Phone_menu'' "><img src="images/system/phone/decline.png"></a><br>'
		-----
			<<set ERROR: FAILED TO CONVERT LITERAL: """<a href""" = ERROR: FAILED TO CONVERT LITERAL: """"exec:gs ''telefon''""" , ERROR: FAILED TO CONVERT LITERAL: """''Phone_menu'' "><<image 'images""" / $system / $phone / ERROR: FAILED TO CONVERT LITERAL: """decline.png'>><""" / ERROR: FAILED TO CONVERT LITERAL: """a><br>'""">>

		-->
		<<warn "CONVERSION ERROR 2e3b2851f1e236fb53477bb3b00dbc04">>
		<<telefon['print']>>
		<<wait 3500>>
		<<gt $location>>
		<<set $contractmessage to null>>
	<<elseif getvar("$subscription['metered_calls']") > 4>>
		<<setinit $subscription['metered_calls'] -= 4>>
	<</if>>
<</if>>
<<if $location_var[$here][0] == 'Phone_call'>>
	<<setinit $telefon['body'] = >>
	<font size=6>Calling <<<<=$npc(''A29'').nickname>>>></font><br>
	<<image 'images/system/phone/icons/icon_npc1.png'>><br><br>
	<!-- FAILED TO CONVERT
		<a href="exec:gs ''telefon'', ''Phone_contactlist'' "><img src="images/system/phone/decline.png"></a><br>'
	-----
		<<set ERROR: FAILED TO CONVERT LITERAL: """<a href""" = ERROR: FAILED TO CONVERT LITERAL: """"exec:gs ''telefon''""" , ERROR: FAILED TO CONVERT LITERAL: """''Phone_contactlist'' "><<image 'images""" / $system / $phone / ERROR: FAILED TO CONVERT LITERAL: """decline.png'>><""" / ERROR: FAILED TO CONVERT LITERAL: """a><br>'""">>

	-->
	<<warn "CONVERSION ERROR f87fdbc8ca2ef0bac2fddbedb86d763f">>
	<<telefon['print']>>
	<<wait 1500>>
	<<set $time.minutes += 1>>
	<<set $callerid = 'images/system/phone/icons/icon_npc1.png'>>
	<<gs 'telefon' 'phone_balance'>>
	<<set $callerid = 'images/system/phone/icons/icon_npc1.png'>>
	<<gs 'telefon' 'phone_call_reject'>>
<</if>>
<<if $location_var[$here][0] == 'phone_call_reject'>>
	<<setinit $telefon['body'] = >>
	<font size=6>Calling...</font><br>
	<img src="<<$callerid>>"><br><br>
	<!-- FAILED TO CONVERT
		<a href="exec:gs ''telefon'', ''Phone_contactlist'' "><img src="images/system/phone/decline.png"></a><br>'
	-----
		<<set ERROR: FAILED TO CONVERT LITERAL: """<a href""" = ERROR: FAILED TO CONVERT LITERAL: """"exec:gs ''telefon''""" , ERROR: FAILED TO CONVERT LITERAL: """''Phone_contactlist'' "><<image 'images""" / $system / $phone / ERROR: FAILED TO CONVERT LITERAL: """decline.png'>><""" / ERROR: FAILED TO CONVERT LITERAL: """a><br>'""">>

	-->
	<<warn "CONVERSION ERROR f87fdbc8ca2ef0bac2fddbedb86d763f">>
	<<telefon['print']>>
<</if>>
<<if $location_var[$here][0] == 'Phone_megafon'>>
	<<if getvar("$subscription['monthly_calls']") == 1>>
		<<set $contractmessage = 'You have a valid monthly contract that will renew on subscription['monthly_calls-date']/month+1'>>
	<<elseif getvar("$subscription['metered_calls']") == 1>>
		<<set $contractmessage = 'You have a valid minutes based contract that still has subscription['metered_calls'] minuets left'>>
	<<elseif getvar("$subscription['monthly_calls']") == 0 and $subscription['monthly_calls-date'] > 0>>
		<<set $contractmessage = '<font size=6>Your mobile contract has expired, you have renew it or buy some minutes.</font><br>'>>
	<<elseif getvar("$subscription['metered_calls']") < 4 and $subscription['metered_calls-date'] > 0>>
		<<set $contractmessage = '<font size=6>You have a minute based plan, but it doesn't have enough minutes left to make a call</font><br>'>>
	<<else>>
		<<set $contractmessage = '<font size=6>You don't have any valid contracts, you should buy one at MegaFon.</font><br>'>>
	<</if>>
	<<setinit $telefon['body'] = >>
	<font size=6>MegaFon</font><br>
	<img src="images/system/phone/theme/<<$phonetheme_name[$pcs_phonetheme]>>/icon_megafon.png" height="80" width="80"><br><br>
	<!-- FAILED TO CONVERT
		<b><<$contractmessage>></b>'
	-----
		ERROR: FAILED TO CONVERT LITERAL: """<b>$contractmessage<""" / ERROR: FAILED TO CONVERT LITERAL: """b>'"""

	-->
	<<warn "CONVERSION ERROR ca7619d440906ebebb16288877e15716">>
	<<telefon['print']>>
	<<set $contractmessage to null>>
<</if>>
<<if $location_var[$here][0] == 'Edit_Custom_list'>>
	<<set $dummyas = arrsize('$contact')>>
	<<warn 'JUMP MARKER ENCOUNTERED: :din_bad_as1'>>
	<<set $dummyas -= 1>>
	<<if getvar("$dummyas") >= 0>>
		<<set $dummyedit = $contact[$dummyas]>>
		<<set $dummyedit1 = dyneval('$result = ''</a><a href="exec:killvar ''''$contact'''',<<dummyas>>>> <<gs ''telefon'' ''''Edit_Custom_list'''' "><b>Remove</b>'' ')>>
		<<set $dummyedit2 = $replace($dummyedit,'<b>Call</b>',$dummyedit1)>>
		$dummyedit2
		<<warn 'JUMP COMMAND ENCOUNTERED: jump din_bad_as1'>>
	<</if>>
	<<set $dummyas to null>>
	<<set $dummyedit to null>>
	<<set $dummyedit1 to null>>
	<<set $dummyedit2 to null>>
	<!-- FAILED TO CONVERT
		pl'<center><a href="exec:gs ''telefon'', ''Phone_menu'' "><img src="images/system/icons/back.png"></a></center>'
	-----
		<<set ERROR: FAILED TO CONVERT LITERAL: """pl'<center><a href""" = ERROR: FAILED TO CONVERT LITERAL: """"exec:gs ''telefon''""" , ERROR: FAILED TO CONVERT LITERAL: """''Phone_menu'' "><<image 'images""" / $system / $icons / ERROR: FAILED TO CONVERT LITERAL: """back.png'>><""" / ERROR: FAILED TO CONVERT LITERAL: """a><""" / ERROR: FAILED TO CONVERT LITERAL: """center>'""">>

	-->
	<<warn "CONVERSION ERROR 2755962b3be37ed6004451fa14b040a1">>
	<!-- !dynamic $telefon['print']-->
<</if>>
<<if $location_var[$here][0] == 'mobilaraz'>>
	<<gs 'din_bad'>>
	<<set $caller = '$telsob'>>
	<<gs 'telefon' 'phone_balance'>>
	<<gs 'telefon' 'phone_call_receive'>>
	<<set $willAgree = (rand(0, 10) > 3)>>
	"Yes, I'm listening," says a voice from the speaker.
	<<if $time.month > 5 and $weather.temperature > 20 and !$weather.isRaining>>
		<<actCLA 'Invite to the park'>>
			"Let''s go for a walk in the park."
			<<if $willAgree>>
				<p>$telsob, "See you in the park in an hour."</p>
				<<act 'Go'>>
					<<gt 'parksvid'>>
				<</act>>
			<<else>>
				<<gs 'telefon' 'telotkaz' $telsob>>
			<</if>>
		<</actCLA>>
	<</if>>
	<<actCLA 'Invite to a movie'>>
		<p>"Want to go see a movie?"</p>
		<<if $willAgree>>
			<p>$telsob, "See you at the movie theater in an hour."</p>
			<<act 'Go'>>
				<<gt 'kinosvid'>>
			<</act>>
		<<else>>
			<<gs 'telefon' 'telotkaz' $telsob>>
		<</if>>
	<</actCLA>>
	<<actCLA 'Invite to the pool hall'>>
		"Let''s play pool."
		<<if $willAgree>>
			<p>$telsob, "See you at the pool hall in an hour."</p>
			<<act 'Go'>>
				<<gt 'billsvid'>>
			<</act>>
		<<else>>
			<<gs 'telefon' 'telotkaz' $telsob>>
		<</if>>
	<</actCLA>>
	<<actCLA 'Invite to the cafe'>>
		"Let''s go to the cafe."
		<<if $willAgree>>
			<p>$telsob, "See you at the cafe in an hour."</p>
			<<act 'Go'>>
				<<gt 'kafesvid'>>
			<</act>>
		<<else>>
			<<gs 'telefon' 'telotkaz' $telsob>>
		<</if>>
	<</actCLA>>
	<<actCLA 'Invite to the casino'>>
		"Let''s go to the casino."
		<<if $willAgree>>
			<p>$telsob, "See you in the casino in an hour."</p>
			<<act 'Go'>>
				<<gt 'kazinosvid'>>
			<</act>>
		<<else>>
			<<gs 'telefon' 'telotkaz' $telsob>>
		<</if>>
	<</actCLA>>
	<<act 'Hangup'>>
		<<gt 'telefon' 'fin'>>
	<</act>>
<</if>>
<!-- !----------------End Old Telephone------------------------------>
<!-- !------------------------------------------------------------------------------->
<!-- ! Support for Hardcoded Lovers (BF/GF)-->
<<if $location_var[$here][0] == 'callingTheLover' and $loverGender[$location_var[$here][1]] == 1>>
	<<gs 'din_bad'>>
	<<set $lover_number = $ARGS[1]>>
	<<set $caller = '$loverdesc[$lover_number]'>>
	<<set $telsob = $caller>>
	<<set $callerid = 'images/characters/shared/headshots_generic/'+lover_picture[$lover_number]+'.jpg'>>
	<<gs 'telefon' 'phone_balance'>>
	<<gs 'telefon' 'phone_call_receive'>>
	<<set $willAgree = (rand(0, 10) > 3)>>
	"Yes, I'm listening," says a voice from the speaker.
	<<if $time.month > 5 and $weather.temperature > 20 and !$weather.isRaining>>
		<<actCLA 'Invite to the park'>>
			"Let''s go for a walk in the park."
			<<if $willAgree>>
				<p>$telsob, "See you in the park in an hour."</p>
				<<act 'Go'>>
					<<gt 'parksvid'>>
				<</act>>
			<<else>>
				<<gs 'telefon' 'telotkaz' $telsob>>
			<</if>>
		<</actCLA>>
	<</if>>
	<<actCLA 'Invite to a movie'>>
		<p>"Want to go see a movie?"</p>
		<<if $willAgree>>
			<p>$telsob, "See you at the movie theater in an hour."</p>
			<<act 'Go'>>
				<<gt 'kinosvid'>>
			<</act>>
		<<else>>
			<<gs 'telefon' 'telotkaz' $telsob>>
		<</if>>
	<</actCLA>>
	<<if $home['town'] == 'city'>>
		<<actCLA 'Invite to the pool hall'>>
			"Let''s play pool."
			<<if $willAgree>>
				<p>$telsob, "See you at the pool hall in an hour."</p>
				<<act 'Go'>>
					<<gt 'billsvid'>>
				<</act>>
			<<else>>
				<<gs 'telefon' 'telotkaz' $telsob>>
			<</if>>
		<</actCLA>>
	<</if>>
	<<actCLA 'Invite to the cafe'>>
		"Let''s go to the cafe."
		<<if $willAgree>>
			<p>$telsob, "See you at the cafe in an hour."</p>
			<<act 'Go'>>
				<<gt 'kafesvid'>>
			<</act>>
		<<else>>
			<<gs 'telefon' 'telotkaz' $telsob>>
		<</if>>
	<</actCLA>>
	<<actCLA 'Invite to the casino'>>
		"Let''s go to the casino."
		<<if $willAgree>>
			<p>$telsob, "See you in the casino in an hour."</p>
			<<act 'Go'>>
				<<gt 'kazinosvid'>>
			<</act>>
		<<else>>
			<<gs 'telefon' 'telotkaz' $telsob>>
		<</if>>
	<</actCLA>>
	<<actCLA 'I think we should break up...'>>
		She sounds hurt, but you insist it is for the best. You both say goodbye and part ways.
		<<gs 'lover' 'remove' $lover_number>>
		<<act 'Hangup'>>
			<<gt 'telefon' 'fin'>>
		<</act>>
	<</actCLA>>
	<<act 'Hangup'>>
		<<gt 'telefon' 'fin'>>
	<</act>>
<</if>>
<<if $location_var[$here][0] == 'callingTheLover' and $loverGender[$location_var[$here][1]] == 0>>
	<<gs 'din_bad'>>
	<<set $lover_number = $ARGS[1]>>
	<<set $caller = '$loverdesc[$lover_number]'>>
	<<set $callerid = 'images/characters/shared/headshots_generic/'+lover_picture[$lover_number]+'.jpg'>>
	<<gs 'telefon' 'phone_balance'>>
	<<gs 'telefon' 'phone_call_receive'>>
	<<set $willAgree = (rand(0, 10) > 3)>>
	"Yes, I'm listening," says a voice from the speaker.
	<<if $time.month > 5 and $weather.temperature > 20 and !$weather.isRaining>>
		<<actCLA 'Invite to the park'>>
			"Let''s go for a walk in the park."
			<<if $willAgree>>
				<p>$loverdesc[$lover_number], "See you in the park in an hour."</p>
				<<act 'Go'>>
					<<gt 'svidboy' 'parksvid'>>
				<</act>>
			<<else>>
				<<gs 'telefon' 'telotkaz' $loverdesc[$lover_number]>>
			<</if>>
		<</actCLA>>
	<</if>>
	<<actCLA 'Invite to a movie'>>
		<p>"Want to go see a movie?"</p>
		<<if $willAgree>>
			<p>$loverdesc[$lover_number], "See you at the movie theater in an hour."</p>
			<<act 'Go'>>
				<<gt 'svidboy' 'kinosvid'>>
			<</act>>
		<<else>>
			<<gs 'telefon' 'telotkaz' $loverdesc[$lover_number]>>
		<</if>>
	<</actCLA>>
	<<if $home['town'] == 'city'>>
		<<actCLA 'Invite to the pool hall'>>
			"Let''s play pool."
			<<if $willAgree>>
				<p>$loverdesc[$lover_number], "See you at the pool hall in an hour."</p>
				<<act 'Go'>>
					<<gt 'svidboy' 'billsvid'>>
				<</act>>
			<<else>>
				<<gs 'telefon' 'telotkaz' $loverdesc[$lover_number]>>
			<</if>>
		<</actCLA>>
	<</if>>
	<<actCLA 'Invite to the cafe'>>
		"Let''s go to the cafe."
		<<if $willAgree>>
			<p>$loverdesc[$lover_number], "See you at the cafe in an hour."</p>
			<<act 'Go'>>
				<<gt 'svidboy' 'kafesvid'>>
			<</act>>
		<<else>>
			<<gs 'telefon' 'telotkaz' $loverdesc[$lover_number]>>
		<</if>>
	<</actCLA>>
	<<actCLA 'I think we should break up...'>>
		He sounds hurt, but you insist it is for the best. You both say goodbye and part ways.
		<<gs 'lover' 'remove' $lover_number>>
		<<act 'Hangup'>>
			<<gt 'telefon' 'fin'>>
		<</act>>
	<</actCLA>>
	<<act 'Hangup'>>
		<<gt 'telefon' 'fin'>>
	<</act>>
<</if>>
<<if $location_var[$here][0] == 'lover' and $loverGender[$location_var[$here][1]] == 0>>
	<<set $lover_number = $ARGS[1]>>
	<<set $ring = 0>>
	<<set $lover_days = $time.daystart - $loverday[$lover_number]>>
	<!-- !-->
	<!-- !gs 'telefon','phone_call_receive'-->
	<<set $svetrand = rand(0, 5)>>
	<<if getvar("$svetrand") == 0>>
		<<set $sveta = 'cutie'>>

	<</if>>
	<<if getvar("$svetrand") == 1>>
		<<set $sveta = 'honey'>>

	<</if>>
	<<if getvar("$svetrand") == 2>>
		<<set $sveta = 'sweetie'>>

	<</if>>
	<<if getvar("$svetrand") == 3>>
		<<set $sveta = 'baby'>>

	<</if>>
	<<if getvar("$svetrand") == 4>>
		<<set $sveta = 'hot stuff'>>

	<</if>>
	<<if getvar("$svetrand") == 5>>
		<<set $sveta = '$pc.name_nick'>>

	<</if>>
	<p>Hey $sveta, it's me, $loverdesc[$lover_number]. How's it going?</p>
	<<actCLA 'Reply'>>
		<p>"Pretty good, you?"</p>
		<p>$loverdesc[$lover_number], "Great, but I kind of miss you, can we meet today?"</p>
		<<if ($pc.pregchem / 24) <= $lover_days and $pc.knowpreg == 1 and getvar("$pc.pregtalk") == 0>>
			<<actCLA 'Tell him he`s going to be a dad'>>
				<<set $pc.pregtalk = 1>>
				"Honey, I'm pregnant with your child."
				<<if getvar("$haraklover["+$lover_number+"]") == 0>>
					<<if getvar("$loverrelation["+$lover_number+"]") >= 90>>
						<<setinit $loverlove[$lover_number] = 1>>
						<p>$loverdesc[$lover_number], "This is wonderful! We have to celebrate!"</p>
						<p>You start talking about living together. $loverdesc[$lover_number] tells you that he is not against it on principle, but first he wants you to meet his parents.</p>
						<p>He warns you that his mother is very demanding and rigorous. $loverdesc[$lover_number] says that he loves his mother and does not want to upset her. Therefore, you must look gorgeous, wear a dress from a boutique, and have well-groomed and curled hair and makeup in moderation.</p>
						<p>When you are totally ready $loverdesc[$lover_number] will take you to his parents.</p>
						<<act 'Hang up'>>
							<<gt 'telefon' 'fin'>>
						<</act>>
						<<actCLA 'Meet tonight'>>
							<<setinit $svidanie[$lover_number] = 1>>
							<p>"How about this evening?"</p>
							<p>$loverdesc[$lover_number], "Sounds great! When can I come to pick you up?"</p>
							<<actCLA 'Pick a time'>>
								<<setinit $meetday[$lover_number] = $time.daystart>>
								<<setinit $meethour[$lover_number] = input ("When do you want to be picked up? It is now <<$mid(100+hour,2,2)>>:<<$mid(100+minut,2,2)>>. [Enter the hour only 0 - 20]")>>
								<<if $meethour[$lover_number] <= $time.hour or getvar("$meethour["+$lover_number+"]") > 23>>
									<<setinit $meethour[$lover_number] = 20>>

								<</if>>
								<p>"How about meethour[$lover_number]:00?"</p>
								<p>$loverdesc[$lover_number], "Okay $sveta, see you at meethour[$lover_number]:00."</p>
								<<act 'Hang up'>>
									<<gt 'telefon' 'fin'>>
								<</act>>
							<</actCLA>>
						<</actCLA>>
					<<elseif getvar("$loverrelation["+$lover_number+"]") < 90>>
						<<set $finances.cash += 20000>>
						<p>$loverdesc[$lover_number] "I'm not yet ready to become a dad. I'll give you the money for an abortion. Get rid of the child.</p>
						<<act 'Hang up'>>
							<<gt 'telefon' 'fin'>>
						<</act>>
					<</if>>
				<<elseif getvar("$haraklover["+$lover_number+"]") == 1>>
					<<set $finances.cash += 20000>>
					<p>$loverdesc[$lover_number] "I'm not yet ready to become a dad. I'll give you the money get an abortion.</p>
					<<act 'Hang up'>>
						<<gt 'telefon' 'fin'>>
					<</act>>
				<<elseif getvar("$haraklover["+$lover_number+"]") == 2>>
					<<set $pc.pregtalk = 0>>
					<p>$loverdesc[$lover_number], "What? You whore! Someone fucked your pussy, and now you drop it on me. You're dumped.</p>
					<<gs 'lover' 'remove' $lover_number>>
					<<act 'Hang up'>>
						<<gt 'telefon' 'fin'>>
					<</act>>
				<</if>>
			<</actCLA>>
		<<elseif ($pc.pregchem / 24) > $lover_days and $pc.knowpreg == 1 and getvar("$pc.pregtalk") == 0>>
			<<actCLA 'Honey, you will soon become a dad'>>
				<<setinit $loverrelation[$lover_number] = 0>>
				"Honey, I'm pregnant with your child."
				<p>$loverdesc[$lover_number], "How the fuck did I manage that? Unless I own a time-machine and went back to before we met and fucked you, it's someone else's, go and tell him. I don't want to see you again, goodbye."</p>
				<<act 'Hang up.'>>
					<<gt 'telefon' 'fin'>>
				<</act>>
			<</actCLA>>
		<<elseif $time.weekday > 1 and $time.weekday < 5 and getvar("$workKafe['job']") == 1>>
			<<actCLA 'Sorry, I`m working today'>>
				"Sorry, I'm working today."
				<p>$loverdesc[$lover_number], "Okay, I'll call tomorrow."</p>
				<<act 'Hang up'>>
					<<gt 'telefon' 'fin'>>
				<</act>>
			<</actCLA>>
		<</if>>
		<<actCLA 'Tonight'>>
			<<setinit $loverrelation[$lover_number] += 1>>
			<<setinit $svidanie[$lover_number] = 1>>
			<<setinit $meetday[$lover_number] = $time.daystart>>
			<p>"How about this evening?"</p>
			<p>$loverdesc[$lover_number], "Sounds great! When can I come to pick you up?"</p>
			<<actCLA 'Pick a time'>>
				<<setinit $meethour[$lover_number] = input ("When do you want to be picked up. It is now <<$mid(100+hour,2,2)>>:<<$mid(100+minut,2,2)>>. [Enter the hour only 0 - 20]")>>
				<<if $meethour[$lover_number] <= $time.hour or getvar("$meethour["+$lover_number+"]") > 23>>
					<<setinit $meethour[$lover_number] = 20>>

				<</if>>
				<p>"How about meethour[$lover_number]:00?."</p>
				<p>$loverdesc[$lover_number], "Okay $sveta, see you at meethour[$lover_number]:00."</p>
				<<act 'Hang up'>>
					<<gt 'telefon' 'fin'>>
				<</act>>
			<</actCLA>>
		<</actCLA>>
		<<actCLA 'Maybe tomorrow'>>
			<<setinit $loverrelation[$lover_number] -= 1>>
			"I'm busy today. Call tomorrow."
			<<if getvar("$loverrelation["+$lover_number+"]") <= 0>>
				 <<gs 'lover' 'remove' $lover_number>>

			<</if>>
			<<if getvar("$loverrelation["+$lover_number+"]") > 0>>
				<p>($loverdesc[$lover_number]) -  Okay, I'll call tomorrow.</p>

			<</if>>
			<<act 'Hang up'>>
				<<gt 'telefon' 'fin'>>
			<</act>>
		<</actCLA>>
		<<actCLA 'I think we should break up...'>>
			He sounds hurt, but you insist it is for the best. You both say goodbye and part ways.
			<<gs 'lover' 'remove' $lover_number>>
			<<act 'Hang up'>>
				<<gt 'telefon' 'fin'>>
			<</act>>
		<</actCLA>>
	<</actCLA>>
	<<actCLA 'Hang up (end relationship)'>>
		<<gs 'lover' 'remove' $lover_number>>
		<<gt 'telefon' 'fin'>>
	<</actCLA>>
<</if>>
<<if $location_var[$here][0] == 'lover' and $loverGender[$location_var[$here][1]] == 1>>
	<<set $lover_number = $ARGS[1]>>
	<<set $ring = 0>>
	<<set $lover_days = $time.daystart - $loverday[$lover_number]>>
	<!-- !-->
	<!-- !gs 'telefon','phone_call_receive'-->
	<<set $svetrand = rand(0, 5)>>
	<<if getvar("$svetrand") == 0>>
		<<set $sveta = 'cutie'>>

	<</if>>
	<<if getvar("$svetrand") == 1>>
		<<set $sveta = 'honey'>>

	<</if>>
	<<if getvar("$svetrand") == 2>>
		<<set $sveta = 'sweetie'>>

	<</if>>
	<<if getvar("$svetrand") == 3>>
		<<set $sveta = 'baby'>>

	<</if>>
	<<if getvar("$svetrand") == 4>>
		<<set $sveta = 'hot stuff'>>

	<</if>>
	<<if getvar("$svetrand") == 5>>
		<<set $sveta = '$pc.name_nick'>>

	<</if>>
	<p>Hey $sveta, it's me, $loverdesc[$lover_number]. How's it going?</p>
	<<actCLA 'Reply'>>
		<p>"Pretty good, you?"</p>
		<p>$loverdesc[$lover_number], "Great, but I kind of miss you, can we meet today?"</p>
		<<actCLA 'Tonight'>>
			<<setinit $loverrelation[$lover_number] += 1>>
			<<setinit $svidanie[$lover_number] = 1>>
			<<setinit $meetday[$lover_number] = $time.daystart>>
			<p>"How about this evening?"</p>
			<p>$loverdesc[$lover_number], "Sounds great! When can I come to pick you up?"</p>
			<<actCLA 'Pick a time'>>
				<<setinit $meethour[$lover_number] = input ("When do you want to be picked up. It is now <<$mid(100+hour,2,2)>>:<<$mid(100+minut,2,2)>>. [Enter the hour only 0 - 20]")>>
				<<if $meethour[$lover_number] <= $time.hour or getvar("$meethour["+$lover_number+"]") > 23>>
					<<setinit $meethour[$lover_number] = 20>>

				<</if>>
				<p>"How about meethour[$lover_number]:00?."</p>
				<p>$loverdesc[$lover_number], "Okay $sveta, see you at meethour[$lover_number]:00."</p>
				<<act 'Hang up'>>
					<<gt 'telefon' 'fin'>>
				<</act>>
			<</actCLA>>
		<</actCLA>>
		<<actCLA 'Maybe tomorrow'>>
			<<setinit $loverrelation[$lover_number] -= 1>>
			"I'm busy today. Call tomorrow."
			<<if getvar("$loverrelation["+$lover_number+"]") <= 0>>
				 <<gs 'lover' 'remove' $lover_number>>

			<</if>>
			<<if getvar("$loverrelation["+$lover_number+"]") > 0>>
				<p>($loverdesc[$lover_number]) -  Okay, I'll call tomorrow.</p>

			<</if>>
			<<act 'Hang up'>>
				<<gt 'telefon' 'fin'>>
			<</act>>
		<</actCLA>>
		<<actCLA 'I think we should break up...'>>
			She sounds hurt, but you insist it is for the best. You both say goodbye and part ways.
			<<gs 'lover' 'remove' $lover_number>>
			<<act 'Hang up'>>
				<<gt 'telefon' 'fin'>>
			<</act>>
		<</actCLA>>
	<</actCLA>>
	<<actCLA 'Hang up (end relationship)'>>
		<<gs 'lover' 'remove' $lover_number>>
		<<gt 'telefon' 'fin'>>
	<</actCLA>>
<</if>>
<!-- !---------------------- End of Lover support-->
<<if $location_var[$here][0] == 'Phone_notebook'>>
	<<gs 'housing' 'rent'>>
	<<setinit $telefon['body'] = >>
	<font size=6>Planner</font><br>
	<img src="images/system/phone/theme/<<$phonetheme_name[$pcs_phonetheme]>>/icon_notebook.png" height="80" width="80"><br>
	<!-- FAILED TO CONVERT
		<<year>>-<<$time.month>>-<<day>>, <<$time.weekday[week]>><br><br>'
	-----
		ERROR: FAILED TO CONVERT LITERAL: """<<year>>""" - $time.month - ERROR: FAILED TO CONVERT LITERAL: """<<day>>""" , ERROR: FAILED TO CONVERT LITERAL: """$time.weekday_name[$time.weekday]<br><br>'"""

	-->
	<<warn "CONVERSION ERROR 8f3585296fab5aaff24b345f7f82ebac">>
	<<set $rent1 = -1>>
	<<set $rent4 = -1>>
	<!-- !! TODO: Will have to change this too, to handle more than 2 rentals.-->
	<<if setup.func('homes_properties', 'is_property_of_status', 'rented', 'city_apartment')>>
		<<set $rent1 = setup.func('homes_properties', 'get_rent_days', 'city_apartment')>>

	<</if>>
	<<if setup.func('homes_properties', 'is_property_of_status', 'rented', 'old_town_apartment')>>
		<<set $rent4 = setup.func('homes_properties', 'get_rent_days', 'old_town_apartment')>>

	<</if>>
	<<set $d1 = $time.day>>
	<<set $w1 = $time.weekday>>
	<<set $m1 = $time.month>>
	<<set $y1 = $time.year>>
	<<set $i = 0>>
	<<set $list = '<br>&emsp;<b>•</b> '>>
	<<warn 'JUMP MARKER ENCOUNTERED: :pnotebook'>>
	<<set $time.daynum = $time.daystart + $i>>
	<<set $calendarday = ''>>
	<<if getvar("$m1") == 1 and getvar("$d1") >= 1 and getvar("$d1") <= 8>>
		<<set $calendarday += $list + 'New Year holidays'>>
		<<if getvar("$d1") == 1>>
			<<sets $calendarday += ', New Year'>>

		<</if>>
		<<if getvar("$d1") == 7>>
			<<sets $calendarday += ', Christmas'>>

		<</if>>
	<</if>>
	<<if getvar("$m1") == 2 and getvar("$d1") == 23>>
		<<set $calendarday += $list + 'Defender of Fatherland Day'>>

	<</if>>
	<<if getvar("$m1") == 3 and getvar("$d1") == 8>>
		<<set $calendarday += $list + 'Women's Day'>>

	<</if>>
	<<if getvar("$m1") == 5 and getvar("$d1") == 1>>
		<<set $calendarday += $list + 'Spring and Labor Day'>>

	<</if>>
	<<if getvar("$m1") == 5 and getvar("$d1") == 2>>
		<<set $calendarday += $list + 'National holiday'>>

	<</if>>
	<<if getvar("$m1") == 5 and getvar("$d1") == 9>>
		<<set $calendarday += $list + 'Victory Day'>>

	<</if>>
	<<if getvar("$m1") == 6 and getvar("$d1") == 12>>
		<<set $calendarday += $list + 'Russia Day'>>

	<</if>>
	<<if getvar("$m1") == 6 and getvar("$d1") == 13>>
		<<set $calendarday += $list + 'National holiday'>>

	<</if>>
	<<if getvar("$m1") == 11 and getvar("$d1") == 4>>
		<<set $calendarday += $list + 'Unity Day'>>

	<</if>>
	<<if setup.startingCharacterTagsIncludes('sg') and $pc.isSchoolStudent>>
		<<if getvar("$m1") == 1 and getvar("$d1") == 1>>
			<<set $calendarday += $list + 'First day of Winter break.'>>

		<</if>>
		<<if getvar("$m1") == 1 and getvar("$d1") == 15>>
			<<set $calendarday += $list + 'Last day of Winter break.'>>

		<</if>>
		<<if getvar("$m1") == 3 and getvar("$d1") == 20>>
			<<set $calendarday += $list + 'First day of Spring break.'>>

		<</if>>
		<<if getvar("$m1") == 3 and getvar("$d1") == 26>>
			<<set $calendarday += $list + 'Last day of Spring break.'>>

		<</if>>
		<<if getvar("$y1") == 2017 and getvar("$m1") == 5 and getvar("$d1") == 25>>
			<<set $calendarday += $list + 'Graduation Day!'>>

		<</if>>
		<<if getvar("$m1") == 6 and getvar("$d1") == 1>>
			<<set $calendarday += $list + 'First day of Summer break.'>>

		<</if>>
		<<if getvar("$m1") == 8 and getvar("$d1") == 31>>
			<<set $calendarday += $list + 'Last day of Summer break.'>>

		<</if>>
		<<if getvar("$m1") == 11 and getvar("$d1") == 4>>
			<<set $calendarday += $list + 'First day of Autumn break.'>>

		<</if>>
		<<if getvar("$m1") == 11 and getvar("$d1") == 11>>
			<<set $calendarday += $list + 'Last day of Autumn break.'>>

		<</if>>
	<</if>>
	<!-- FAILED TO CONVERT
		if daynum >= daylastperiod+28 and daynum < daylastperiod+31:$calendarday += $list + '<font color=''red''><b>Menstruation!</b></font>'
	-----
		<<if $time.daynum >= $time.daylastperiod + 28 and $time.daynum < $time.daylastperiod + 31>>
		<!-- FAILED TO CONVERT
	$calendarday += $list + '<font color=''red''><b>Menstruation!</b></font>'
-----
	<<set $calendarday += $list + ERROR: FAILED TO CONVERT LITERAL: """'<font color=''red''><b>Menstruation!<""" / ERROR: FAILED TO CONVERT LITERAL: """b><""" / ERROR: FAILED TO CONVERT LITERAL: """font>'""">>

-->
<<warn "CONVERSION ERROR 859df84df1b61f0573898737f9a603b9">>

	<</if>>

	-->
	<<warn "CONVERSION ERROR a63875d9bd5c29cb45649a7a52d8ba26">>
	<!-- FAILED TO CONVERT
		if daynum >= daylastperiod+12 and daynum < daylastperiod+14:$calendarday += $list + '<font color=#336600><b>Ovulation!</b></font>'
	-----
		<<if $time.daynum >= $time.daylastperiod + 12 and $time.daynum < $time.daylastperiod + 14>>
		<!-- FAILED TO CONVERT
	$calendarday += $list + '<font color=#336600><b>Ovulation!</b></font>'
-----
	<<set $calendarday += $list + ERROR: FAILED TO CONVERT LITERAL: """'<font color=#336600><b>Ovulation!<""" / ERROR: FAILED TO CONVERT LITERAL: """b><""" / ERROR: FAILED TO CONVERT LITERAL: """font>'""">>

-->
<<warn "CONVERSION ERROR a0622098b59c67badc0590f0c836ee27">>

	<</if>>

	-->
	<<warn "CONVERSION ERROR 4c3b632d68229a25afd924d54c8b2b19">>
	<!-- FAILED TO CONVERT
		if pregchem >= 6720:$calendarday += $list + '<font color=''red''><b>Birthing day!</b></font>'
	-----
		<<if getvar("$pc.pregchem") >= 6720>>
		<!-- FAILED TO CONVERT
	$calendarday += $list + '<font color=''red''><b>Birthing day!</b></font>'
-----
	<<set $calendarday += $list + ERROR: FAILED TO CONVERT LITERAL: """'<font color=''red''><b>Birthing day!<""" / ERROR: FAILED TO CONVERT LITERAL: """b><""" / ERROR: FAILED TO CONVERT LITERAL: """font>'""">>

-->
<<warn "CONVERSION ERROR 75b75fd11c711758dba3a17d1f90b53f">>

	<</if>>

	-->
	<<warn "CONVERSION ERROR 290664430bc27c382949ce0de8e7e6bb">>
	<!-- FAILED TO CONVERT
		if w1 < 5 and (workSec >= 1 or BurgerQW['Secretary'] = 1):$calendarday += $list + 'Working as a secretary. <i>(9:00 - 17:00)</i>'
	-----
		<<if getvar("$w1") < 5 and (getvar("$workSec") >= 1 or getvar("$BurgerQW['Secretary']") == 1)>>
		<!-- FAILED TO CONVERT
	$calendarday += $list + 'Working as a secretary. <i>(9:00 - 17:00)</i>'
-----
	<<set $calendarday += $list + ERROR: FAILED TO CONVERT LITERAL: """'Working as a secretary. <i>(ERROR: FAILED TO CONVERT LITERAL: """9:00""" - ERROR: FAILED TO CONVERT LITERAL: """17:00""")<""" / ERROR: FAILED TO CONVERT LITERAL: """i>'""">>

-->
<<warn "CONVERSION ERROR 9529721191dce9dda0b0db29e00dd0cf">>

	<</if>>

	-->
	<<warn "CONVERSION ERROR 552be77287140ae01988e15480cf03d0">>
	<<if getvar("$w1") < 5 and getvar("$workFabrika") == 1>>
		<<set $calendarday += $list + 'Working as a seamstress. '>>
		<!-- FAILED TO CONVERT
			if age < 18:$calendarday += '<i>(16:00 - 20:00)</i>' else $calendarday += '<i>(8:00 - 16:00)</i>'
		-----
			<<if getvar("$pc.age") < 18>>
			<!-- FAILED TO CONVERT
	$calendarday += '<i>(16:00 - 20:00)</i>' else $calendarday += '<i>(8:00 - 16:00)</i>'
-----
	<<set $calendarday += '<i>(ERROR: FAILED TO CONVERT LITERAL: """16:00""" - ERROR: FAILED TO CONVERT LITERAL: """20:00""")</i>' else $calendarday += '<i>(ERROR: FAILED TO CONVERT LITERAL: """8:00""" - ERROR: FAILED TO CONVERT LITERAL: """16:00""")</i>'>>

-->
<<warn "CONVERSION ERROR bebbb36ca7af3b2bbe0ce691b0e5e8b1">>

		<</if>>

		-->
		<<warn "CONVERSION ERROR 6b2004856e2d4f7de662d82920a5a305">>
	<</if>>
	<!-- FAILED TO CONVERT
		if w1 > 1 and w1 <= 5 and workhosp = 1:$calendarday += $list + 'Working as a nurse. <i>(8:00 - 16:00)</i>'
	-----
		<<if getvar("$w1") > 1 and getvar("$w1") <= 5 and getvar("$workhosp") == 1>>
		<!-- FAILED TO CONVERT
	$calendarday += $list + 'Working as a nurse. <i>(8:00 - 16:00)</i>'
-----
	<<set $calendarday += $list + ERROR: FAILED TO CONVERT LITERAL: """'Working as a nurse. <i>(ERROR: FAILED TO CONVERT LITERAL: """8:00""" - ERROR: FAILED TO CONVERT LITERAL: """16:00""")<""" / ERROR: FAILED TO CONVERT LITERAL: """i>'""">>

-->
<<warn "CONVERSION ERROR 5035bb46d4509b7608de8a3e52e5a99d">>

	<</if>>

	-->
	<<warn "CONVERSION ERROR db4b8360c484c26c0c77c2a6b27d8fa4">>
	<!-- FAILED TO CONVERT
		if worksalon = 1 and (w1 = 1 or w1 = 3 or w1 = 5):$calendarday += $list + 'Working as a masseuse. <i>(9:00 - 17:00)</i>'
	-----
		<<if getvar("$worksalon") == 1 and (getvar("$w1") == 1 or getvar("$w1") == 3 or getvar("$w1") == 5)>>
		<!-- FAILED TO CONVERT
	$calendarday += $list + 'Working as a masseuse. <i>(9:00 - 17:00)</i>'
-----
	<<set $calendarday += $list + ERROR: FAILED TO CONVERT LITERAL: """'Working as a masseuse. <i>(ERROR: FAILED TO CONVERT LITERAL: """9:00""" - ERROR: FAILED TO CONVERT LITERAL: """17:00""")<""" / ERROR: FAILED TO CONVERT LITERAL: """i>'""">>

-->
<<warn "CONVERSION ERROR 3ab057df7a7ad555d8ae4d8ca37239c1">>

	<</if>>

	-->
	<<warn "CONVERSION ERROR 6a3daa650a332652bfc859e779bba0ec">>
	<!-- !!		if maidqw > 0:$calendarday += '<br>&emsp;<b>•</b> Working as maid. <i>(16:00 - 19:00)</i>'-->
	<!-- FAILED TO CONVERT
		if pfilmday[i] > 0:$calendarday += $list + 'Porn shoot: <i><<$porndesc[pfilmday[i]]>></i>'
	-----
		<<if getvar("$pfilmday["+$i+"]") > 0>>
		<!-- FAILED TO CONVERT
	$calendarday += $list + 'Porn shoot: <i><<$porndesc[pfilmday[$i]]>></i>'
-----
	<<set $calendarday += $list + ERROR: FAILED TO CONVERT LITERAL: """'Porn shoot: <i>$porndesc[$pfilmday[$i]]<""" / ERROR: FAILED TO CONVERT LITERAL: """i>'""">>

-->
<<warn "CONVERSION ERROR 68ba378b09af4f5c611ddf8b9f0b4a72">>

	<</if>>

	-->
	<<warn "CONVERSION ERROR 74a120c827fea7574fb41a3db40e98e2">>
	<!-- FAILED TO CONVERT
		if d1 = 25 and (BurgerQW['Secretary'] = 1 or workKafe['job'] = 1 or workhosp = 1 or worksalon = 1 or tanwork = 1 or workSec = 1 or workFabrika = 1):$calendarday += $list + '<i>Pay day!</i>'
	-----
		<<if getvar("$d1") == 25 and (getvar("$BurgerQW['Secretary']") == 1 or getvar("$workKafe['job']") == 1 or getvar("$workhosp") == 1 or getvar("$worksalon") == 1 or getvar("$tanwork") == 1 or getvar("$workSec") == 1 or getvar("$workFabrika") == 1)>>
		<!-- FAILED TO CONVERT
	$calendarday += $list + '<i>Pay day!</i>'
-----
	<<set $calendarday += $list + ERROR: FAILED TO CONVERT LITERAL: """'<i>Pay day!<""" / ERROR: FAILED TO CONVERT LITERAL: """i>'""">>

-->
<<warn "CONVERSION ERROR 86a710ec1b18e2f6b56871ab441eda8a">>

	<</if>>

	-->
	<<warn "CONVERSION ERROR 5facac3565a1be3d0f42b2c32934d228">>
	<<if $d1 == $nyp_day and getvar("$m1") == 12 and $pc.isSchoolStudent and setup.startingCharacterTagsIncludes('sg')>>
		<<set $calendarday += $list + 'New Year's party at 14:00!'>>

	<</if>>
	<<if ($npc('A33').QW - 2) % 2 == 1 and $sisboyday + 1 == $time.daynum>>
		<<if getvar("$sisboytrioQW") == 1>>
			<!-- FAILED TO CONVERT
				$calendarday += $list + '<font color="orange">Threesome with Anya and Roma at 18:00</font>'
			-----
				<<set $calendarday += $list + ERROR: FAILED TO CONVERT LITERAL: """'<font color="orange">Threesome with Anya and Roma at 18:00<""" / ERROR: FAILED TO CONVERT LITERAL: """font>'""">>

			-->
			<<warn "CONVERSION ERROR fefe959cc8607305a4e2428f8f820735">>
		<<else>>
			<!-- FAILED TO CONVERT
				$calendarday += $list + '<font color="orange">Anya having sex with Roma at 18:00</font>'
			-----
				<<set $calendarday += $list + ERROR: FAILED TO CONVERT LITERAL: """'<font color="orange">Anya having sex with Roma at 18:00<""" / ERROR: FAILED TO CONVERT LITERAL: """font>'""">>

			-->
			<<warn "CONVERSION ERROR 078087e9ef95ea9d0dc6aa88062cb3b1">>
		<</if>>
	<</if>>
	<!-- FAILED TO CONVERT
		if sisboyparty = 2 and sisboyparty_day+1 = daynum:$calendarday += $list + '<font color="orange">Party at Rex''s, gathering before 18:00 at Community Center</font>'
	-----
		<<if getvar("$sisboyparty") == 2 and $sisboyparty_day + 1 == $time.daynum>>
		<!-- FAILED TO CONVERT
	$calendarday += $list + '<font color="orange">Party at Rex''s, gathering before 18:00 at Community Center</font>'
-----
	<<set $calendarday += $list + ERROR: FAILED TO CONVERT LITERAL: """'<font color="orange">Party at Rex''s""" , ERROR: FAILED TO CONVERT LITERAL: """gathering before 18:00 at Community Center<""" / ERROR: FAILED TO CONVERT LITERAL: """font>'""">>

-->
<<warn "CONVERSION ERROR b6b8fb9647ca539254b959bae3293708">>

	<</if>>

	-->
	<<warn "CONVERSION ERROR de4bbae9fb604b3140c997f365935aac">>
	<<if getvar("$rent1") == 0>>
		<<set $calendarday += $list + 'Rent on city apartment expires!'>>

	<</if>>
	<<if getvar("$rent4") == 0>>
		<<set $calendarday += $list + 'Rent on Pushkin apartment expires!'>>

	<</if>>
	<<if $pc.birthday == $d1 and $pc.birthmonth == $m1>>
		<<set $calendarday += $list + 'My birthday!'>>

	<</if>>
	<<if getvar("$kid") > 0>>
		<<set $k1 = $kid>>
		<<warn 'JUMP MARKER ENCOUNTERED: :kiddieloop'>>
		<<if $time.daykid[$k1] == $d1 and $time.monthkid[$k1] == $m1>>
			<<set $calendarday += $list + 'Birthday of my $polreb[$k1] $kidname[$k1], my kid. baby!'>>

		<</if>>
		<<if getvar("$k1") > 1>>
			<<setn $k1 -= 1>>
		<</if>>
	<</if>>
	<<if $calendarday != ''>>
		<<setinit $telefon['body'] += '<b>$time.monthName[$m1] d1, $time.weekday_name[$w1]:</b>'>>
		<<setinit $telefon['body'] += $calendarday + '<br>'>>
	<</if>>
	<<if getvar("$i") < 14>>
		<<set $rent1 -= 1>>
		<<set $rent4 -= 1>>
		<<set $i += 1>>
		<<set $w1 += 1>>
		<<if getvar("$w1") > 7>>
			<<set $w1 = 1>>

		<</if>>
		<<set $d1 += 1>>
		<<if $time.monthsend[$m1] < $d1>>
			<<set $m1 += 1>> <<set $d1 = 1>>
			<<if getvar("$m1") == 13>>
				<<set $m1 = 1>> <<setn $y1 += 1>>

			<</if>>
		<</if>>
		<<warn 'JUMP COMMAND ENCOUNTERED: jump pnotebook'>>
	<</if>>
	<<set $calendarday to null>>
	<<set $rent1 to null>>
	<<set $rent4 to null>>
	<<set $d1 to null>>
	<<set $w1 to null>>
	<<set $m1 to null>>
	<<set $y1 to null>>
	<<set $time.daynum to null>>
	<<telefon['print']>>
<</if>>
<!-- !!----------------------------------------Camera--------------------------------------------------->
<!-- !!for viewing photos on your phone-->
<<if $location_var[$here][0] == 'Phone_pictures'>>
	<<gt 'phone_selfies' 'selfies'>>
<</if>>
<!-- !!picking the selfie image when taking photos, this sets the location variable-->
<!-- !{
$ARGS[1] is phone location if left blank it is a generic selfie	(one of the locations in $selfieLoc[])
$ARGS[2] is for flashing when clothed if left blank then it is not flashing
} -->
<<if $location_var[$here][0] == 'Phone_camera_selfie'>>
	<<set $time.minutes += rand(5,7)>>
	<<if $location_var[$here][1] != ''>>
		<<gs 'telefon' 'Phone_selfie_image' $location_var[$here][1] $location_var[$here][2]>>
	<<else>>
		<<set $phone_rand = RAND(1,selfieClotot[0])>>
		<<run State.setVar($selfieLoc[0]+'_closelfie['+phone_rand+']',1)>>

		<<if getvar("$usePopUps") == 1>>
			<<msg '<img src="images/pc/activities/phone/selfies/<<$selfieLoc[0]>>/clothed/<<$selfieFilePrefix[0]>><<phone_rand>>.jpg">'>>
		<<else>>
			<!-- FAILED TO CONVERT
				view 'images/pc/activities/phone/selfies/<<$selfieLoc[0]>>/clothed/<<$selfieFilePrefix[0]>><<phone_rand>>.jpg'
			-----
				view 'images / $pc / $activities / $phone / $selfies / $selfieLoc[0] / $clothed / ERROR: FAILED TO CONVERT LITERAL: """$selfieFilePrefix[0]<<phone_rand>>.jpg'"""

			-->
			<<warn "CONVERSION ERROR 8394c50fdc3ae82e05100cbaadf8bb9f">>
		<</if>>
	<</if>>
	<!-- !if spdirtyf > 0: phone_rand = RAND (m,n) - for SELF in the semen-->
	<!-- !if photo_event_pic = x: phone_rand = RAND (x,y) - for photos during the events (by heart)-->
	<!-- !msg '<<image 'images/system/phone/phone_selfie<<phone_rand>>.jpg'>>'-->
<</if>>
<!-- !!taking selfies, this chooses a random image for the location for clothed, underwear and nude-->
<!-- !{
$ARGS[1] is phone location (one of the locations in $selfieLoc[])
$ARGS[2] is for flashing when clothed if left blank then it is not flashing
} -->
<<if $location_var[$here][0] == 'Phone_selfie_image'>>
	<<if $location_var[$here][2] == ''>>
		<<if $wardrobe.PCloswimwear == 1>>
			<!-- !!changing to and unmixed variable so the rng will work-->
			<<if getvar("$Enable_Android") == 1>>
				<<set temp_swim = $selfieSwimtot[arrpos(''$selfieLoc'', $ARGS[1],1)]>>
			<<else>>
				<<set temp_swim = $selfieSwimtot[arrpos(1, ''$selfieLoc'', $ARGS[1])]>>
			<</if>>
			<<if getvar("$temp_swim") > 0>>
				<<set $phone_rand = rand(1,temp_swim)>>
				<!-- !!Setting the image owned flag to 1-->
				<<run State.setVar($ARGS[1]+'_swim['+phone_rand+']',1)>>

				<<if getvar("$usePopUps") == 1>>
					<<msg '<img src="images/pc/activities/phone/selfies/<<$ARGS[1]>>/bikini/<<phone_rand>>.jpg">'>>
				<<else>>
					<!-- FAILED TO CONVERT
						view 'images/pc/activities/phone/selfies/<<$ARGS[1]>>/bikini/<<phone_rand>>.jpg'
					-----
						view 'images / $pc / $activities / $phone / $selfies / $location_var[$here][1] / $bikini / ERROR: FAILED TO CONVERT LITERAL: """<<phone_rand>>.jpg'"""

					-->
					<<warn "CONVERSION ERROR c9e3b2b95298c26342a234ee5d8b241d">>
				<</if>>
			<</if>>
		<<elseif $wardrobe.clothingworntype != 'nude'>>
			<!-- !!changing to and unmixed variable so the rng will work-->
			<<if getvar("$Enable_Android") == 1>>
				<<set temp_clotot = $selfieClotot[arrpos(''$selfieLoc'', $ARGS[1],1)]>>
			<<else>>
				<<set temp_clotot = $selfieClotot[arrpos(1, ''$selfieLoc'', $ARGS[1])]>>
			<</if>>
			<<if getvar("$temp_clotot") > 0>>
				<<set $phone_rand = rand(1,temp_clotot)>>
				<!-- !!Setting the image owned flag to 1-->
				<<run State.setVar($ARGS[1]+'_closelfie['+phone_rand+']',1)>>

				<<if getvar("$usePopUps") == 1>>
					<<msg '<img src="images/pc/activities/phone/selfies/<<$ARGS[1]>>/clothed/<<phone_rand>>.jpg">'>>
				<<else>>
					<!-- FAILED TO CONVERT
						view 'images/pc/activities/phone/selfies/<<$ARGS[1]>>/clothed/<<phone_rand>>.jpg'
					-----
						view 'images / $pc / $activities / $phone / $selfies / $location_var[$here][1] / $clothed / ERROR: FAILED TO CONVERT LITERAL: """<<phone_rand>>.jpg'"""

					-->
					<<warn "CONVERSION ERROR 745522772ba96965a2ae6e19f6e944f0">>
				<</if>>
			<</if>>
		<<elseif $wardrobe.isWearingPanties>>
			<<if getvar("$Enable_Android") == 1>>
				<<set temp_undtot = $selfieUndtot[arrpos(''$selfieLoc'', $ARGS[1],1)]>>
			<<else>>
				<<set temp_undtot = $selfieUndtot[arrpos(1, ''$selfieLoc'', $ARGS[1])]>>
			<</if>>
			<<if getvar("$temp_undtot") > 0>>
				<<set $phone_rand = rand(1,temp_undtot)>>
				<<run State.setVar($ARGS[1]+'_undselfie['+phone_rand+']',1)>>

				<<if getvar("$usePopUps") == 1>>
					<<msg '<img src="images/pc/activities/phone/selfies/<<$ARGS[1]>>/underwear/<<phone_rand>>.jpg">'>>
				<<else>>
					<!-- FAILED TO CONVERT
						view 'images/pc/activities/phone/selfies/<<$ARGS[1]>>/underwear/<<phone_rand>>.jpg'
					-----
						view 'images / $pc / $activities / $phone / $selfies / $location_var[$here][1] / $underwear / ERROR: FAILED TO CONVERT LITERAL: """<<phone_rand>>.jpg'"""

					-->
					<<warn "CONVERSION ERROR 12430375886c0d8541bd072ed2f16f47">>
				<</if>>
			<</if>>
		<<else>>
			<<if getvar("$Enable_Android") == 1>>
				<<set temp_nudtot = $selfieNudtot[arrpos(''$selfieLoc'', $ARGS[1],1)]>>
			<<else>>
				<<set temp_nudtot = $selfieNudtot[arrpos(1, ''$selfieLoc'', $ARGS[1])]>>
			<</if>>
			<<if getvar("$temp_nudtot") > 0>>
				<<set $phone_rand = rand(1,temp_nudtot)>>
				<<run State.setVar($ARGS[1]+'_nudselfie['+phone_rand+']',1)>>

				<<if getvar("$usePopUps") == 1>>
					<<msg '<img src="images/pc/activities/phone/selfies/<<$ARGS[1]>>/nude/<<phone_rand>>.jpg">'>>
				<<else>>
					<!-- FAILED TO CONVERT
						view 'images/pc/activities/phone/selfies/<<$ARGS[1]>>/nude/<<phone_rand>>.jpg'
					-----
						view 'images / $pc / $activities / $phone / $selfies / $location_var[$here][1] / $nude / ERROR: FAILED TO CONVERT LITERAL: """<<phone_rand>>.jpg'"""

					-->
					<<warn "CONVERSION ERROR a35a397763dbeca40d1a3a9326c56289">>
				<</if>>
			<</if>>
		<</if>>
	<<else>>
		<<if $location_var[$here][2] == 'tits'>>
			<<if getvar("$Enable_Android") == 1>>
				<<set temp_titflash = $selfieTitflash[arrpos(''$selfieLoc'', $ARGS[1],1)]>>
			<<else>>
				<<set temp_titflash = $selfieTitflash[arrpos(1, ''$selfieLoc'', $ARGS[1])]>>
			<</if>>
			<<if getvar("$temp_titflash") > 0>>
				<<set $phone_rand = rand(1,temp_titflash)>>
				<<run State.setVar($ARGS[1]+'_titflash['+phone_rand+']',1)>>

				<<if getvar("$usePopUps") == 1>>
					<<msg '<img src="images/pc/activities/phone/selfies/<<$ARGS[1]>>/titflash/<<phone_rand>>.jpg">'>>
				<<else>>
					<!-- FAILED TO CONVERT
						view 'images/pc/activities/phone/selfies/<<$ARGS[1]>>/titflash/<<phone_rand>>.jpg'
					-----
						view 'images / $pc / $activities / $phone / $selfies / $location_var[$here][1] / $titflash / ERROR: FAILED TO CONVERT LITERAL: """<<phone_rand>>.jpg'"""

					-->
					<<warn "CONVERSION ERROR cab75aeab449804d75ee7fc6354adba0">>
				<</if>>
			<</if>>
		<<elseif $location_var[$here][2] == 'ass'>>
			<<if getvar("$Enable_Android") == 1>>
				<<set temp_assflash = $selfieAssflash[arrpos(''$selfieLoc'', $ARGS[1],1)]>>
			<<else>>
				<<set temp_assflash = $selfieAssflash[arrpos(1, ''$selfieLoc'', $ARGS[1])]>>
			<</if>>
			<<if getvar("$temp_assflash") > 0>>
				<<set $phone_rand = rand(1,temp_assflash)>>
				<<run State.setVar($ARGS[1]+'_assflash['+phone_rand+']',1)>>

				<<if getvar("$usePopUps") == 1>>
					<<msg '<img src="images/pc/activities/phone/selfies/<<$ARGS[1]>>/assflash/<<phone_rand>>.jpg">'>>
				<<else>>
					<!-- FAILED TO CONVERT
						view 'images/pc/activities/phone/selfies/<<$ARGS[1]>>/assflash/<<phone_rand>>.jpg'
					-----
						view 'images / $pc / $activities / $phone / $selfies / $location_var[$here][1] / $assflash / ERROR: FAILED TO CONVERT LITERAL: """<<phone_rand>>.jpg'"""

					-->
					<<warn "CONVERSION ERROR f06edf5bca12940c43514fd3b6a2b214">>
				<</if>>
			<</if>>
		<<elseif $location_var[$here][2] == 'pussy'>>
			<<if getvar("$Enable_Android") == 1>>
				<<set temp_pussyflash = $selfiePussyflash[arrpos(''$selfieLoc'', $ARGS[1],1)]>>
			<<else>>
				<<set temp_pussyflash = $selfiePussyflash[arrpos(1, ''$selfieLoc'', $ARGS[1])]>>
			<</if>>
			<<if getvar("$temp_pussyflash") > 0>>
				<<set $phone_rand = rand(1,temp_pussyflash)>>
				<<run State.setVar($ARGS[1]+'_pussyflash['+phone_rand+']',1)>>

				<<if getvar("$usePopUps") == 1>>
					<<msg '<img src="images/pc/activities/phone/selfies/<<$ARGS[1]>>/pussyflash/<<phone_rand>>.jpg">'>>
				<<else>>
					<!-- FAILED TO CONVERT
						view 'images/pc/activities/phone/selfies/<<$ARGS[1]>>/pussyflash/<<phone_rand>>.jpg'
					-----
						view 'images / $pc / $activities / $phone / $selfies / $location_var[$here][1] / $pussyflash / ERROR: FAILED TO CONVERT LITERAL: """<<phone_rand>>.jpg'"""

					-->
					<<warn "CONVERSION ERROR ac8ec29df3660778d73b986f4a7b8c4f">>
				<</if>>
			<</if>>
		<</if>>
	<</if>>
<</if>>
<!-- !!taking selfies in the shower or bath-->
<<if $location_var[$here][0] == 'Phone_selfie_image_bathing'>>
	<<set $time.minutes += rand(5,7)>>
	<<if $location_var[$here][1] == 'shower'>>
		<!-- !!changing to and unmixed variable so the rng will work-->
		<<if getvar("$Enable_Android") == 1>>
			<<set temp_showertot = $selfieShowertot[arrpos(''$selfieLoc'', ''bathroom'',1)]>>
		<<else>>
			<<set temp_showertot = $selfieShowertot[arrpos(1, ''$selfieLoc'', ''bathroom'')]>>
		<</if>>
		<<set $phone_rand = rand(1,temp_showertot)>>
		<!-- !!Setting the image owned flag to 1-->
		<<setinit $bathroom_showerselfie['+phone_rand+'] = 1>>
		<<if getvar("$usePopUps") == 1>>
			<<msg '<<image 'images/pc/activities/phone/selfies/bathroom/shower/<<phone_rand>>.jpg'>>'>>
		<<else>>
			<!-- FAILED TO CONVERT
				view 'images/pc/activities/phone/selfies/bathroom/shower/<<phone_rand>>.jpg'
			-----
				view 'images / $pc / $activities / $phone / $selfies / $bathroom / $shower / ERROR: FAILED TO CONVERT LITERAL: """<<phone_rand>>.jpg'"""

			-->
			<<warn "CONVERSION ERROR f35b02d971b3504840fbeddd9e276f85">>
		<</if>>
	<<elseif $location_var[$here][1] == 'bath'>>
		<<if getvar("$Enable_Android") == 1>>
			<<set temp_bathtot = $selfieBathtot[arrpos(''$selfieLoc'', ''bathroom'',1)]>>
		<<else>>
			<<set temp_bathtot = $selfieBathtot[arrpos(1, ''$selfieLoc'', ''bathroom'')]>>
		<</if>>
		<<set $phone_rand = rand(1,temp_bathtot)>>
		<<setinit $bathroom_bathselfie['+phone_rand+'] = 1>>
		<<if getvar("$usePopUps") == 1>>
			<<msg '<<image 'images/pc/activities/phone/selfies/bathroom/bath/<<phone_rand>>.jpg'>>'>>
		<<else>>
			<!-- FAILED TO CONVERT
				view 'images/pc/activities/phone/selfies/bathroom/bath/<<phone_rand>>.jpg'
			-----
				view 'images / $pc / $activities / $phone / $selfies / $bathroom / $bath / ERROR: FAILED TO CONVERT LITERAL: """<<phone_rand>>.jpg'"""

			-->
			<<warn "CONVERSION ERROR c67aa813c39a2fad41719ae1889063b7">>
		<</if>>
	<</if>>
<</if>>
<!-- !!for taking photos - only selfies for now-->
<<if $location_var[$here][0] == 'Phone_camera'>>
	<<gs 'phone_selfies' 'Phone_selfie_totals'>>
	<<if $locclass == 'bedr'>>
		<<set $phone_loc = 'bedroom'>>
	<<elseif $locclass == 'kitr'>>
		<<set $phone_loc = 'kitchen'>>
	<<elseif $locclass == 'livingr'>>
		<<set $phone_loc = 'livingroom'>>
	<<elseif $locclass == 'changingroom'>>
		<<set $phone_loc = 'changingroom'>>
	<<elseif $locclass == 'city_park'>>
		<<set $phone_loc = 'park'>>
	<<elseif $locclass == 'locker'>>
		<<set $phone_loc = 'locker'>>
	<<elseif $locclass == 'beach'>>
		<<set $phone_loc = 'beach'>>
	<<elseif $locclass == 'beach'>>
		<<set $phone_loc = 'beach'>>
	<<elseif $locclass == 'classroom'>>
		<<set $phone_loc = 'classroom'>>
	<<elseif $locclass == 'school_bathroom'>>
		<<set $phone_loc = 'school_bathroom'>>
	<<elseif $locclass == 'restroom'>>
		<<set $phone_loc = 'restroom'>>
	<<elseif $location_type == 'bathroom'>>
		<<set $phone_loc = 'bathroom'>>
	<<else>>
		<<set $phone_loc = ''>>
	<</if>>
	<!-- FAILED TO CONVERT
		$telefon['body'] = '<font size=6>Camera</font><br>
	-----
		<<setinit $telefon['body'] = ERROR: FAILED TO CONVERT LITERAL: """'<font size=6>Camera<""" / ERROR: FAILED TO CONVERT LITERAL: """font><br>""">>

	-->
	<<warn "CONVERSION ERROR 21522a3fde540cc786f7628425b7fed8">>
	<!-- FAILED TO CONVERT
		<img src="images/system/phone/theme/<<$phonetheme_name[pcs_phonetheme]>>/icon_camera.png" height="80" width="80"><br><br>'
	-----
		<<set ERROR: FAILED TO CONVERT LITERAL: """<img src""" = "images / $system / $phone / $theme / $phonetheme_name[$pcs_phonetheme] / ERROR: FAILED TO CONVERT LITERAL: """icon_camera.png" height="80" width="80"><br><br>'""">>

	-->
	<<warn "CONVERSION ERROR e255c8f61c1fc2a77fdf93538b534d44">>
	<!-- !! Take a selfie depending on which clothes you are wearing-->
	<<setinit $telefon['body'] += '<a href="exec:gs 'exp_gain' , 'photoskl' , 1>> <<gs 'telefon' 'Phone_camera_selfie' '$phone_loc' "><b>Take a selfie</b></a><br>'>>
	<!-- !! Flashing selfie-->
	<<if $wardrobe.clothingworntype != 'nude' and $phone_loc <> ''>>
		<<if getvar("$Enable_Android") == 1>>
			<<set $locIndex = arrpos('$selfieLoc', $phone_loc,1)>>
		<<else>>
			<<set $locIndex = arrpos(1, '$selfieLoc', $phone_loc)>>
		<</if>>
		<<if ($pc.pcs_inhib >= 35 or getvar("$exhibitionist_lvl") > 0 or $phone_loc == 'bedroom') and dyneval("result = <<selfieTitflash[$locIndex]>>") > 0>>
			<<setinit $telefon['body'] += '<a href="exec:gs 'exp_gain' , 'photoskl' , 1>> <<gs 'telefon' 'Phone_camera_selfie' '$phone_loc' 'tits' "><b>Flash your tits for a selfie</b></a><br>'>>
		<</if>>
		<<if (getvar("$exhibitionist_lvl") > 0 or $phone_loc == 'bedroom') and dyneval("result = <<selfieAssflash[$locIndex]>>") > 0>>
			<<setinit $telefon['body'] += '<a href="exec:gs 'exp_gain' , 'photoskl' , 1>> <<gs 'telefon' 'Phone_camera_selfie' '$phone_loc' 'ass' "><b>Flash your ass for a selfie</b></a><br>'>>
		<</if>>
		<<if (getvar("$exhibitionist_lvl") > 1 or $phone_loc == 'bedroom') and dyneval("result = <<selfiePussyflash[$locIndex]>>") > 0>>
			<<setinit $telefon['body'] += '<a href="exec:gs 'exp_gain' , 'photoskl' , 1>> <<gs 'telefon' 'Phone_camera_selfie' '$phone_loc' 'pussy' "><b>Flash your pussy for a selfie</b></a><br>'>>
		<</if>>
	<</if>>
	<<telefon['print']>>
<</if>>
<!-- !!-----------------------------------end of Camera-------------------------------------------->
<!-- !!-----------------------------------start of sms-------------------------------------------->
<!-- !{
Send SMS lists the current contacts, then clicking on a contact gives a list of messages that can be sent.
Receive messages lists the sms messages sent to the player, these can be deleted, they will be in bold until read.
To add an incoming message
gs 'telefon', 'add_sms', 'A1', 'Test message the text goes here', 'images/pc/activities/phone/selfies/bathroom/underwear/1.jpg', 'images/pc/activities/phone/selfies/school_bathroom/pussyflash/1.jpg'
A1 is the NPC code (A1 is Dmitriy Nosov "Dimka")
You can have up to 4 pictures attached to the message
To add an out going message that can be sent
gs 'telefon', 'add_sms_to_send', 'A1', 'Test message the text goes here'
To add a contact if it doesn't exist
if arrpos('$contact', 'A1') = -1: gs 'telefon', 'AddContact', 'A1', 'images/characters/shared/headshots_main/big1.jpg', "", "1 = 0", "", "", 0
SMS Arrays storing received messages and messages that can be sent
Received Messages
telefon['UnreadSMS'] = number of unread SMS messages
$SMSContact[] = NPC code for contact. ('A129', 'A29', 'B13', 'C14') that sent the sms
$SMSMessage[] = text for the sms message
$SMSTime[] = date time the message was received
$SMSPicture1[] = url for first picture sent as part of the message
$SMSPicture2[] = url for second picture sent as part of the message
$SMSPicture3[] = url for third picture sent as part of the message
$SMSPicture4[] = url for fourth picture sent as part of the message
SMSMessageRead[] = 0 unread, 1 read
Send Messages
$SMSSendContact[] = NPC code for contact. ('A129', 'A29', 'B13', 'C14') that sent the sms
$SMSSendMessage[] = text for the sms message
$SMSSendCode[] = Code to execute for Incoming call
SMSSendRepeatable[] = 0 delete option after send, 1 don't delete option
$SMSSendDeleteId[] = id passed by the caller
} -->
<<if $location_var[$here][0] == 'Phone_sms'>>
	<<setinit $telefon['body'] = >>
	<font size=6>SMS</font><br>
	<!-- FAILED TO CONVERT
		<img src="images/system/phone/theme/<<$phonetheme_name[pcs_phonetheme]>>/<<iif(telefon[''UnreadSMS'']=0,''icon_sms.png'',''icon_sms_new.gif'')>>" height="80" width="80"><br>'
	-----
		<<set ERROR: FAILED TO CONVERT LITERAL: """<img src""" = "images / $system / $phone / $theme / $phonetheme_name[$pcs_phonetheme] / ERROR: FAILED TO CONVERT LITERAL: """<<iif(telefon['UnreadSMS']=0""" , 'icon_sms.png' , 'icon_sms_new.gif')" height="80" width="80"><br>'>>

	-->
	<<warn "CONVERSION ERROR bcefc6037af847b1b35d0d00dc606211">>
	<<setinit $telefon['body'] += '<b><<link "Send new SMS">><<gs 'telefon' 'send_sms'>><</link>></b><br>'>>
	<<setinit $telefon['body'] += '<TABLE cellspacing="0" width="80%"><TR><TH>Icon</TH><TH>Name</TH><TH align="right">Received</TH><TH></TH></TR>'>>
	<!-- !!iterating all Messages-->
	<!-- !!reset and recalculate unread messages count, in case they get out of sync-->
	<<setinit $telefon['UnreadSMS'] = 0>>
	<<set $i = 0>>
	<<warn 'JUMP MARKER ENCOUNTERED: :smsloop'>>
	<<if $i < arrsize('$SMSContact')>>
		<!-- !! if the person sending is in the contact list display the names and icon-->
		<<setinit $telefon['contactid'] = arrpos('$contact',$SMSContact[$i])>>
		<<if getvar("$telefon['contactid']") == -1>>
			<<setinit $telefonCon['NPCName'] = ''>>
			<<setinit $telefonCon['Icon'] = 'icon_na.png'>>
		<<else>>
			<<setinit $telefonCon['NPCName'] = $npc($contact[$telefon['contactid').nickname]]>>
			<<setinit $telefonCon['Icon'] = $contactIcon[$telefon['contactid']]>>
		<</if>>
		<<if getvar("$SMSMessageRead["+$i+"]") == 0>>
			<<setinit $telefon['UnreadSMS'] += 1>>

		<</if>>
		<<setinit $telefon['body'] += dyneval($telefon['SMS'],i,$telefonCon['Icon'],$telefonCon['NPCName'],$SMSTime[$i],SMSMessageRead[$i])>>
		<<set $i += 1>>
		<<warn 'JUMP COMMAND ENCOUNTERED: jump smsloop'>>
	<</if>>
	<<setinit $telefon['body'] += '<b><<link "Delete All">><<gs 'telefon' 'delete_sms' '0' 'all'>><</link>></b><br>'>>
	<<setinit $telefon['body'] += '</TABLE><br>'>>
	<<telefon['print']>>
	<<set $i to null>>
<</if>>
<!-- !{
New SMS Message
If NPC is not in the contacts list of the phone it will be displayed as unknown until the contact has been added
$ARGS[1] = NPC code for contact. ('A129', 'A29', 'B13', 'C14')
$ARGS[2] = Message text to be displayed
$ARGS[3] = path to a picture to be displayed (optional)
$ARGS[4] = path to a picture to be displayed (optional)
$ARGS[5] = path to a picture to be displayed (optional)
$ARGS[6] = path to a picture to be displayed (optional)
} -->
<<if $location_var[$here][0] == 'add_sms'>>
	<<setinit $SMSContact[$telefon['SMSCount']] = $location_var[$here][1]>>
	<<setinit $SMSMessage[$telefon['SMSCount']] = $location_var[$here][2]>>
	<<setinit $SMSTime[$telefon['SMSCount']] = '$mid(100+hour,2,2):$mid(100+minut,2,2) $time.weekday_name[$time.weekday] day $time.month year'>>
	<<setinit $SMSPicture1[$telefon['SMSCount']] = $location_var[$here][3]>>
	<<setinit $SMSPicture2[$telefon['SMSCount']] = $location_var[$here][4]>>
	<<setinit $SMSPicture3[$telefon['SMSCount']] = $location_var[$here][5]>>
	<<setinit $SMSPicture4[$telefon['SMSCount']] = $location_var[$here][6]>>
	<<setinit $SMSMessageRead[$telefon['SMSCount']] = 0>>
	<<setinit $telefon['SMSCount'] += 1>>
	<<setinit $telefon['UnreadSMS'] += 1>>
<</if>>
<<if $location_var[$here][0] == 'delete_sms'>>
	<<setinit $telefon['SMSid'] = $ARGS[1]>>
	<<set $SMSContact[$telefon['SMSid']] to null>>
	<<set $SMSMessage[$telefon['SMSid']] to null>>
	<<set $SMSTime[$telefon['SMSid']] to null>>
	<<set $SMSPicture1[$telefon['SMSid']] to null>>
	<<set $SMSPicture2[$telefon['SMSid']] to null>>
	<<set $SMSPicture3[$telefon['SMSid']] to null>>
	<<set $SMSPicture4[$telefon['SMSid']] to null>>
	<<set $SMSMessageRead[$telefon['SMSid']] to null>>
	<<setinit $telefon['SMSCount'] -= 1>>
	<<if $location_var[$here][2] == 'all' and getvar("$telefon['SMSCount']") > 0>>
		<<gs 'telefon' 'delete_sms' '0' 'all'>>
	<</if>>
	<<gs 'telefon' 'Phone_sms'>>
<</if>>
<<if $location_var[$here][0] == 'show_sms'>>
	<<setinit $telefon['SMSid'] = $ARGS[1]>>
	<!-- !!set to read and update the number of unread messages-->
	<<if $SMSMessageRead[$telefon['SMSid']] == 0>>
		<<setinit $telefon['UnreadSMS'] -= 1>>
		<<setinit $SMSMessageRead[$telefon['SMSid']] = 1>>
	<</if>>
	<!-- !! Get image and name if in phone contacts otherwise show unknown-->
	<<setinit $telefon['contactid'] = arrpos('$contact',$SMSContact[$telefon['SMSid']])>>
	<<if getvar("$telefon['contactid']") == -1>>
		<<setinit $telefonCon['NPCName'] = ''>>
		<<setinit $telefonCon['Icon'] = 'icon_na.png'>>
	<<else>>
		<<setinit $telefonCon['NPCName'] = $npc($contact[$telefon['contactid').nickname]]>>
		<<setinit $telefonCon['Icon'] = $contactIcon[$telefon['contactid']]>>
	<</if>>
	<!-- !!If file extension is not given, .png is assumed-->
	<<if instr($telefonCon['Icon'],'.') == 0>>
		<<setinit $telefonCon['Icon'] += '.png'>>
	<</if>>
	<!-- !!If path is not given, default phone icon path is assumed-->
	<<if instr($telefonCon['Icon'],'/') == 0>>
		<<setinit $telefonCon['Icon'] = 'images / $system / $phone / $icons /  + $telefonCon['Icon']>>
	<</if>>
	<<setinit $telefon['body'] = >>
	<font size=6>SMS</font><br>
	<!-- FAILED TO CONVERT
		<img src="images/system/phone/theme/<<$phonetheme_name[pcs_phonetheme]>>/<<iif(telefon[''UnreadSMS'']=0,''icon_sms.png'',''icon_sms_new.gif'')>>" height="80" width="80"><br>'
	-----
		<<set ERROR: FAILED TO CONVERT LITERAL: """<img src""" = "images / $system / $phone / $theme / $phonetheme_name[$pcs_phonetheme] / ERROR: FAILED TO CONVERT LITERAL: """<<iif(telefon['UnreadSMS']=0""" , 'icon_sms.png' , 'icon_sms_new.gif')" height="80" width="80"><br>'>>

	-->
	<<warn "CONVERSION ERROR bcefc6037af847b1b35d0d00dc606211">>
	<<setinit $telefon['body'] += '<TABLE cellspacing="0" width="80%">'>>
	<<setinit $telefon['body'] += '<TR><TD><img height=100 src="$telefonCon['Icon']"></TD><TD>$telefonCon['NPCName']</TD></TR>'>>
	<<setinit $telefon['body'] += '<TR><TD colspan="2">$SMSMessage[$telefon['SMSid']]</TD></TR>'>>
	<<if $SMSPicture1[$telefon['SMSid']] <> ''>>
		<<setinit $telefon['body'] += '<TR><TD colspan="2"><img src="$SMSPicture1[$telefon['SMSid']]"></TD></TR>'>>
	<</if>>
	<<if $SMSPicture2[$telefon['SMSid']] <> ''>>
		<<setinit $telefon['body'] += '<TR><TD colspan="2"><img src="$SMSPicture2[$telefon['SMSid']]"></TD></TR>'>>
	<</if>>
	<<if $SMSPicture3[$telefon['SMSid']] <> ''>>
		<<setinit $telefon['body'] += '<TR><TD colspan="2"><img src="$SMSPicture3[$telefon['SMSid']]"></TD></TR>'>>
	<</if>>
	<<if $SMSPicture4[$telefon['SMSid']] <> ''>>
		<<setinit $telefon['body'] += '<TR><TD colspan="2"><img src="$SMSPicture4[$telefon['SMSid']]"></TD></TR>'>>
	<</if>>
	<<setinit $telefon['body'] += '</TABLE><br>'>>
	<<setinit $telefon['backButton'] = 'gs 'telefon', 'Phone_sms' '>>
	<<telefon['print']>>
<</if>>
<!-- !! This is the formatting function for a row in the SMS message table. SHould be run as a DYNEVAL()-->
<!-- !{
SMS Row in messages table
ARGS[0] = message id
$ARGS[1] = NPC icon
$ARGS[2] = NPC Nickname
$ARGS[3] = Time received
$ARGS[4] = 0 unread, 1 read
} -->
<!-- !! List of Contacts that you can send sms messages to-->
<<if $location_var[$here][0] == 'send_sms'>>
	<<setinit $telefon['backButton'] = 'gs 'telefon', 'Phone_sms''>>
	<<setinit $telefon['body'] = >>
	<font size=6>Send SMS</font><br>
	<!-- FAILED TO CONVERT
		<img src="images/system/phone/theme/<<$phonetheme_name[pcs_phonetheme]>>/<<iif(telefon[''UnreadSMS'']=0,''icon_sms.png'',''icon_sms_new.gif'')>>" height="80" width="80"><br>'
	-----
		<<set ERROR: FAILED TO CONVERT LITERAL: """<img src""" = "images / $system / $phone / $theme / $phonetheme_name[$pcs_phonetheme] / ERROR: FAILED TO CONVERT LITERAL: """<<iif(telefon['UnreadSMS']=0""" , 'icon_sms.png' , 'icon_sms_new.gif')" height="80" width="80"><br>'>>

	-->
	<<warn "CONVERSION ERROR bcefc6037af847b1b35d0d00dc606211">>
	<<if getvar("$subscription['metered_calls']") == 1 and getvar("$subscription['sms_limit']") > 0>>
		<<setinit $telefon['body'] += '<br/>'>>
		<<setinit $telefon['body'] += '<b>You still can send $subscription['sms_limit'] text messages on your contract</b>'>>
	<</if>>
	<!-- !! Colour correction for editor ''''-->
	<<setinit $telefon['body'] += '<TABLE cellspacing="0" width="80%">'>>
	<!-- !!iterating all Contacts-->
	<<set $i = 0>>
	<<warn 'JUMP MARKER ENCOUNTERED: :smscontactloop'>>
	<<if $i < arrsize('$contact')>>
		<<if getvar("$contactAnon["+$i+"]") == 0>>
			<<setinit $telefon['body'] += dyneval($telefon['contactsms'],i)>>
		<</if>>
		<<set $i += 1>>
		<<warn 'JUMP COMMAND ENCOUNTERED: jump smscontactloop'>>
	<</if>>
	<<setinit $telefon['body'] += '</TABLE><br>'>>
	<<telefon['print']>>
	<<set $i to null>>
<</if>>
<!-- !! This is the formatting function for a row in the Contact List. SHould be run as a DYNEVAL()-->
<!-- !! $ARGS[0] = index of contact in the conntact arrays-->
<!-- !! List of SMS messages available to be sent to an NPC-->
<!-- !! $ARGS[1] = NPC code for the contact we want to display messages for-->
<<if $location_var[$here][0] == 'npcSendListSms'>>
	<<setinit $telefon['backButton'] = 'gs 'telefon', 'send_sms''>>
	<<setinit $telefon['body'] = >>
	<font size=6>Send SMS</font><br>
	<!-- FAILED TO CONVERT
		<img src="images/system/phone/theme/<<$phonetheme_name[pcs_phonetheme]>>/<<iif(telefon[''UnreadSMS'']=0,''icon_sms.png'',''icon_sms_new.gif'')>>" height="80" width="80"><br>'
	-----
		<<set ERROR: FAILED TO CONVERT LITERAL: """<img src""" = "images / $system / $phone / $theme / $phonetheme_name[$pcs_phonetheme] / ERROR: FAILED TO CONVERT LITERAL: """<<iif(telefon['UnreadSMS']=0""" , 'icon_sms.png' , 'icon_sms_new.gif')" height="80" width="80"><br>'>>

	-->
	<<warn "CONVERSION ERROR bcefc6037af847b1b35d0d00dc606211">>
	<<setinit $telefon['body'] += '<TABLE cellspacing="0" width="80%">'>>
	<!-- !!iterating all send sms messages-->
	<<set $i = 0>>
	<<warn 'JUMP MARKER ENCOUNTERED: :npcSendListSmsLoop'>>
	<<if $i < arrsize('$SMSSendContact')>>
		<<if $SMSSendContact[$i] == $location_var[$here][1]>>
			<<setinit $telefon['body'] += dyneval($telefon['smsMessageToSend'],i)>>
		<</if>>
		<<set $i += 1>>
		<<warn 'JUMP COMMAND ENCOUNTERED: jump npcSendListSmsLoop'>>
	<</if>>
	<<setinit $telefon['body'] += '</TABLE><br>'>>
	<<telefon['print']>>
	<<set $i to null>>
<</if>>
<!-- !! This is the formatting function for a row in the messages to send List. SHould be run as a DYNEVAL()-->
<!-- !! ARGS[0] = index of the message-->
<<if $location_var[$here][0] == 'smsSendMessage'>>
	dynamic '$SMSSendCode[$ARGS[1]]'
	<<gs 'internet_mobile' 'send_sms'>>
	<<if $SMSSendRepeatable[$location_var[$here][1]] == 0>>
		<<gs 'telefon' 'delete_sms_send_index' $ARGS[1]>>
	<</if>>
	<<gs 'telefon' 'Phone_sms'>>
<</if>>
<!-- !{
Add a new message that can be sent by the player
$ARGS[1] NPC code for contact. ('A129', 'A29', 'B13', 'C14') that sent the sms
$ARGS[2] text for the sms message
$ARGS[3] Code to execute when the sms is sent
ARGS[4] 0 delete option after send, 1 dont delete option
$ARGS[5] id passed by the caller to identify the option to be deleted if it needs to be removed from the options
} -->
<<if $location_var[$here][0] == 'add_sms_to_send'>>
	<<set $i = arrsize('$SMSSendContact')>>
	<<setinit $SMSSendContact[$i] = $location_var[$here][1]>>
	<<setinit $SMSSendMessage[$i] = $location_var[$here][2]>>
	<<setinit $SMSSendCode[$i] = $location_var[$here][3]>>
	<<setinit $SMSSendRepeatable[$i] = $ARGS[4]>>
	<<setinit $SMSSendDeleteId[$i] = $location_var[$here][5]>>
<</if>>
<<if $location_var[$here][0] == 'delete_sms_send_index'>>
	<<set $SMSSendContact[$ARGS[1]] to null>>
	<<set $SMSSendMessage[$ARGS[1]] to null>>
	<<set $SMSSendCode[$ARGS[1]] to null>>
	<<set $SMSSendRepeatable[$ARGS[1]] to null>>
	<<set $SMSSendDeleteId[$ARGS[1]] to null>>
<</if>>
<!-- !{
$ARGS[1] = NPC code for contact. ('A129', 'A29', 'B13', 'C14')
$ARGS[2] = Delete id of the message ($SMSSendDeleteId)
} -->
<<if $location_var[$here][0] == 'delete_sms_send_id'>>
	<<setinit $telefon['SMStoDeleteFound'] = 'No'>>
	<<set $i = 0>>
	<<warn 'JUMP MARKER ENCOUNTERED: :findSmsToDeleteLoop'>>
	<<if $i < arrsize('$SMSSendContact') and $telefon['SMStoDeleteFound'] == 'No'>>
		<<if $SMSSendContact[$i] == $location_var[$here][1] and $SMSSendDeleteId[$i] == $location_var[$here][2]>>
			<<gs 'telefon' 'delete_sms_send_index' $i>>
			<<setinit $telefon['SMStoDeleteFound'] = 'Yes'>>
		<</if>>
		<<set $i += 1>>
		<<warn 'JUMP COMMAND ENCOUNTERED: jump findSmsToDeleteLoop'>>
	<</if>>
<</if>>
<!-- !!-----------------------------------end of sms-------------------------------------------->
<<if $location_var[$here][0] == 'Phone_wheather'>>
	<<setinit $telefon['body'] = >>
	<font size=6>Weather</font><br>
	<img src="images/system/phone/theme/<<$phonetheme_name[$pcs_phonetheme]>>/icon_weather.png" height="80" width="80"><br><br>
	<b>Temperature:</b><br>
	<<$temperature>>. <<$osadki>><br>
	<!-- FAILED TO CONVERT
		P.O.P. today is <<weatherFall>>%<br>'
	-----
		ERROR: FAILED TO CONVERT LITERAL: """P.O.P. today is <<weatherFall>>""" % ERROR: FAILED TO CONVERT LITERAL: """<br>'"""

	-->
	<<warn "CONVERSION ERROR b8a9376f9fda0963916914f513d06aec">>
	<<telefon['print']>>
<</if>>
<<if $location_var[$here][0] == 'Phone_calendar'>>
	<<setinit $telefon['body'] = >>
	<font size=6>Calendar</font><br>
	<img src="images/system/phone/theme/<<$phonetheme_name[$pcs_phonetheme]>>/icon_calendar.png" height="80" width="80"><br><br>
	<B>Today:</B><br>
	<!-- FAILED TO CONVERT
		<<$time.weekday[week]>>, <<day>> <<$time.month>> <<year>><br>'
	-----
		$time.weekday_name[$time.weekday] , ERROR: FAILED TO CONVERT LITERAL: """<<day>> $time.month <<year>><br>'"""

	-->
	<<warn "CONVERSION ERROR 3dc053ad50b3aaabda49747456e0e9ca">>
	<<telefon['print']>>
<</if>>
<<if $location_var[$here][0] == 'Phone_media'>>
	<<setinit $telefon['body'] = >>
	<font size=6>Media</font><br>
	<img src="images/system/phone/theme/<<$phonetheme_name[$pcs_phonetheme]>>/icon_music.png" height="80" width="80"><br>
	<!-- FAILED TO CONVERT
		<b>This option is not active</b><br>'
	-----
		ERROR: FAILED TO CONVERT LITERAL: """<b>This option is not active<""" / ERROR: FAILED TO CONVERT LITERAL: """b><br>'"""

	-->
	<<warn "CONVERSION ERROR dbc03ce7a978314aca7681d0c4785adc">>
	<<telefon['print']>>
<</if>>
<<if $location_var[$here][0] == 'Phone_menu'>>
	<<if getvar("$phone_off") == 0>>
		<<setinit $telefon['body'] = >>
		<a href="exec:gs ''telefon'', ''Phone_camera'' "><img src="images/system/phone/theme/<<$phonetheme_name[$pcs_phonetheme]>>/icon_camera.png" height="80" width="80"></a>
		<a href="exec:gs ''telefon'', ''Phone_calendar'' "><img src="images/system/phone/theme/<<$phonetheme_name[$pcs_phonetheme]>>/icon_calendar.png" height="80" width="80"></a>
		<a href="exec:gs ''telefon'', ''Phone_pictures'' "><img src="images/system/phone/theme/<<$phonetheme_name[$pcs_phonetheme]>>/icon_pictures.png" height="80" width="80"></a>
		<br>
		<a href="exec:gs ''telefon'', ''Phone_media'' "><img src="images/system/phone/theme/<<$phonetheme_name[$pcs_phonetheme]>>/icon_music.png" height="80" width="80"></a>
		<a href="exec:gs ''telefon'', ''Phone_notebook'' "><img src="images/system/phone/theme/<<$phonetheme_name[$pcs_phonetheme]>>/icon_notebook.png" height="80" width="80"></a>
		<a href="exec:gs ''telefon'', ''Phone_wheather'' "><img src="images/system/phone/theme/<<$phonetheme_name[$pcs_phonetheme]>>/icon_weather.png" height="80" width="80"></a>
		<br>
		<a href="exec:gs ''telefon'', ''ContactList'' "><img src="images/system/phone/theme/<<$phonetheme_name[$pcs_phonetheme]>>/icon_call.png" height="80" width="80"></a>
		<a href="exec:gs ''telefon'', ''Phone_sms'' "><img src="images/system/phone/theme/<<$phonetheme_name[$pcs_phonetheme]>>/<<iif(telefon[''UnreadSMS'']=0,''icon_sms.png'',''icon_sms_new.gif'')>>" height="80" width="80"></a>
		<a href="exec:gs ''telefon'', ''Phone_megafon'' "><img src="images/system/phone/theme/<<$phonetheme_name[$pcs_phonetheme]>>/icon_megafon.png" height="80" width="80"></a>
		<!-- FAILED TO CONVERT
			<br>'
		-----
			ERROR: FAILED TO CONVERT LITERAL: """<br>'"""

		-->
		<<warn "CONVERSION ERROR 2f34f4dd8a4cc48f5c842ae3accadd22">>
		<<if getvar("$menu_off") == 1>>
			<<setinit $telefon['body'] += '<a href="exec:gs 'obj_din', 'menu_disabled'"><img src="images/system/phone/theme/$phonetheme_name[$pcs_phonetheme]/icon_settings.png" height="80" width="80"></a><br>'>>
		<<else>>
			<!-- FAILED TO CONVERT
				$telefon['body'] += '<a href="exec:killvar ''menu_page'' & gs ''Cheatmenu_din'' & dynamic $cheatmenu[''setting'']"><img src="images/system/phone/theme/<<$phonetheme_name[pcs_phonetheme]>>/icon_settings.png" height="80" width="80"></a><br>'
			-----
				<<setinit $telefon['body'] += '<a href="exec:killvar 'menu_page'>> <<gs 'Cheatmenu_din'>> <<set ERROR: FAILED TO CONVERT LITERAL: """dynamic $cheatmenu['setting']"><img src""" = "images / $system / $phone / $theme / $phonetheme_name[$pcs_phonetheme] / ERROR: FAILED TO CONVERT LITERAL: """icon_settings.png" height="80" width="80"><""" / ERROR: FAILED TO CONVERT LITERAL: """a><br>'""">>

			-->
			<<warn "CONVERSION ERROR 4b30249515b3e8a873ca28238159ad4e">>
		<</if>>
		<<telefon['print']>>
	<<else>>
		<font color="red"><b>Your phone is disabled for this event</b></font>
	<</if>>
<</if>>
<<if $location_var[$here][0] == 'Add_contact'>>
	<<set $dummy = INPUT('Enter a note:')>>
	<<run $contact.push(dyneval($telefon['contact'],$ARGS[1],$dummy,$ARGS[2]))>>
	<<set $dummy to null>>
<</if>>
<<if $location_var[$here][0] == 'telotkaz'>>
	<<set $time.minutes += 10>>
	<p>$ARGS[1], "Sorry, I'm busy right now, maybe next time."</p>
	<<act 'Hangup'>>
		<<gt 'telefon' 'fin'>>
	<</act>>
<</if>>
<<if $location_var[$here][0] == 'fin'>>
	<<set $lover_number to null>>
	<<gt $location>>
<</if>>
<<if $location_var[$here][0] == 'setup'>>
	<!-- !! array $$phonetheme_name is built.-->
	<!-- !! might need a tweak to have it rebuilt when new themes are available.-->
	<<setinit $phonetheme_name[0] = 'Custom_Standard'>>
	<<setinit $phonetheme_name[1] = 'Bimbo'>>
	<<setinit $phonetheme_name[2] = 'Custom_Aluminus'>>
	<<setinit $phonetheme_name[3] = 'Custom_Bottlecapped'>>
	<<setinit $phonetheme_name[4] = 'Custom_Galactic'>>
	<<setinit $phonetheme_name[5] = 'Custom_Vectored'>>
	<<setinit $phonetheme_name[6] = 'Custom_Veneer'>>
	<<setinit $phonetheme_name[7] = 'Custom_Voidwalker'>>
	<<setinit $phonetheme_name[8] = 'Custom_Voidwalker Red'>>
	<<setinit $phonetheme_name[9] = 'Custom_Voidwalker Toxic'>>
	<<setinit $phonetheme_name[10] = 'Gopnik'>>
	<<setinit $phonetheme_name[11] = 'Sports'>>
	<<setinit $phonetheme_name[12] = 'Succubus'>>
	<<setinit $phonetheme_name[13] = 'Woodshop'>>
	<<setinit $phonetheme[0] = 1>>
	<<gs 'phone_selfies' 'Phone_selfie_totals'>>
<</if>>
:: telefonheader_macro[widget]
<<widget 'telefonheader'>>
	<<if getvar("$telefon['UnreadSMS']") > 0>>
		<<setinit $telefon['SMSstatus'] = 'You have telefon['UnreadSMS'] unread message(s)'>>
	<<else>>
		<<setinit $telefon['SMSstatus'] = ''>>
	<</if>>
	<!-- FAILED TO CONVERT
	$result = '<center>
-----
	<<set $result = ERROR: FAILED TO CONVERT LITERAL: """'<center>""">>

-->
<<warn "CONVERSION ERROR 80353b27d42ecc975fdab0132a975ff1">>
	<b><<$mid(100+hour,2,2)>>:<<$mid(100+minut,2,2)>></b><br>
	<TABLE cellspacing="0" width="80%">
	<TR>
	<TD><<image 'images/system/icons/icon_statusbar_left.png'>></TD>
	<TD><<$telefon[''SMSstatus'']>></TD>
	<TD align="right"><<image 'images/system/icons/icon_statusbar_right.png'>></TD>
	</TR>
	<!-- FAILED TO CONVERT
	</TABLE><br>'
-----
	ERROR: FAILED TO CONVERT LITERAL: """<""" / ERROR: FAILED TO CONVERT LITERAL: """TABLE><br>'"""

-->
<<warn "CONVERSION ERROR 35c9fafeb6f0b947228c8ab2fed29619">>
<</widget>>
:: telefonfooter_macro[widget]
<<widget 'telefonfooter'>>
	<<if $telefon['backButton'] == ''>>
	<<setinit $telefon['backButton'] = 'gs 'telefon', 'Phone_menu''>>

<</if>>
	<!-- FAILED TO CONVERT
	$result = '	<a href="exec:<<$telefon[''backButton'']>>"><img src="images/system/icons/back.png"></a><br><br>
-----
	<<set $result = ERROR: FAILED TO CONVERT LITERAL: """'	<a href="exec:$telefon['backButton']"><<image 'images""" / $system / $icons / ERROR: FAILED TO CONVERT LITERAL: """back.png'>><""" / ERROR: FAILED TO CONVERT LITERAL: """a><br><br>""">>

-->
<<warn "CONVERSION ERROR 4b68b3151eb9ebe33b90b9c376d5dfa2">>
	<<link "Put Phone Away.">><</link>><br>
	<!-- FAILED TO CONVERT
	</center>'
-----
	ERROR: FAILED TO CONVERT LITERAL: """<""" / ERROR: FAILED TO CONVERT LITERAL: """center>'"""

-->
<<warn "CONVERSION ERROR 4929f2c41ca2fd9e7e6efbb87973773c">>
	<<setinit $telefon['backButton'] = 'gs 'telefon', 'Phone_menu''>>
<</widget>>
:: telefonprint_macro[widget]
<<widget 'telefonprint'>>
		setup.func('cleanHTML',dyneval($telefon['header']) + $telefon['body'] + dyneval($telefon['footer']))
<</widget>>
:: telefoncontact_macro[widget]
<<widget 'telefoncontact'>>
	<!-- !! Contact Row in phone contact list-->
	<!-- !! _args[0] = NPC icon-->
	<!-- !! _args[1] = NPC Nickname-->
	<!-- !! _args[2] = Code to execute for making a Call-->
	<!-- !! _args[3] = if statement for determining if NPC is avaiable-->
	<<setinit $telefon['ContactIcon'] = _args[0]>>
	<<setinit $telefon['ContactNickName'] = _args[1]>>
	<<setinit $telefon['ContactCallCode'] = _args[2]>>
	<<setinit $telefon['ContactCallSchedule'] = _args[3]>>
	<!-- !!If file extension is not given, .png is assumed-->
	<<if instr($telefon['ContactIcon'],'.') == 0>>
		<<setinit $telefon['ContactIcon'] += '.png'>>
	<</if>>
	<!-- !!If path is not given, default phone icon path is assumed-->
	<<if instr($telefon['ContactIcon'],'/') == 0>>
		<<setinit $telefon['ContactIcon'] = 'images / $system / $phone / $icons /  + $telefon['ContactIcon']>>
	<</if>>
	<!-- !!If Contact is not in available timeframe, we disable contact calling-->
	<<if dyneval('$result = iif(<<$telefon["ContactCallSchedule"]>>,1,0)') = 0>>
		<<setinit $telefon['ContactCallCode'] = "gs 'telefon', 'phone_call_reject'">>
	<</if>>
	<!-- FAILED TO CONVERT
	$result = '<TR>
-----
	<<set $result = ERROR: FAILED TO CONVERT LITERAL: """'<TR>""">>

-->
<<warn "CONVERSION ERROR edb5281e131fc51d862cca5d07e312c8">>
	<TD><img src="<<$telefon[''ContactIcon'']>>" width="75"></TD>
	<TD><<$telefon[''ContactNickName'']>></TD>
	<TD align="right"><a href="exec:$callerid = ''<<$telefon[''ContactIcon'']>>'' & <<$telefon[''ContactCallCode'']>>"><b>Call</b></a></TD>
	<!-- FAILED TO CONVERT
	</TR>'
-----
	ERROR: FAILED TO CONVERT LITERAL: """<""" / ERROR: FAILED TO CONVERT LITERAL: """TR>'"""

-->
<<warn "CONVERSION ERROR 0eefe07fed739a6b0ee6d0d33049cbab">>
<</widget>>
:: telefonSMS_macro[widget]
<<widget 'telefonSMS'>>
	<<setinit $telefon['SMSid'] = _args[0]>>
	<<setinit $telefon['ContactIcon'] = _args[1]>>
	<<setinit $telefon['ContactNickName'] = _args[2]>>
	<<setinit $telefon['SMSTime'] = _args[3]>>
	<<setinit $telefon['SMSStatus'] = _args[4]>>
	<!-- !!If file extension is not given, .png is assumed-->
	<<if instr($telefon['ContactIcon'],'.') == 0>>
		<<setinit $telefon['ContactIcon'] += '.png'>>
	<</if>>
	<!-- !!If path is not given, default phone icon path is assumed-->
	<<if instr($telefon['ContactIcon'],'/') == 0>>
		<<setinit $telefon['ContactIcon'] = 'images / $system / $phone / $icons /  + $telefon['ContactIcon']>>
	<</if>>
	<!-- !! unread will be bold-->
	<<if getvar("$telefon['SMSStatus']") == 0>>
		<<setinit $telefon['SMSstyle1'] = '<b>'>>
		<<setinit $telefon['SMSstyle2'] = '</b>'>>
	<<else>>
		<<setinit $telefon['SMSstyle1'] = ''>>
		<<setinit $telefon['SMSstyle2'] = ''>>
	<</if>>
	<!-- FAILED TO CONVERT
	$result = '<TR>
-----
	<<set $result = ERROR: FAILED TO CONVERT LITERAL: """'<TR>""">>

-->
<<warn "CONVERSION ERROR edb5281e131fc51d862cca5d07e312c8">>
	<TD><img height=100 src="<<$telefon[''ContactIcon'']>>"></TD>
	<TD><<$telefon[''SMSstyle1'']>><<$telefon[''ContactNickName'']>><<$telefon[''SMSstyle2'']>></TD>
	<TD align="right"><<$telefon[''SMSstyle1'']>><a href="exec:gs ''telefon'', ''show_sms'', <<telefon[''SMSid'']>>"><<$telefon[''SMSTime'']>></a><<$telefon[''SMSstyle2'']>></TD>
	<!-- FAILED TO CONVERT
	<TD><<$telefon[''SMSstyle1'']>><a href="exec:gs ''telefon'', ''delete_sms'', <<telefon[''SMSid'']>>">Delete</a><<$telefon[''SMSstyle2'']>></TD>
-----
	<TD><<$telefon[''SMSstyle1'']>><<link "Delete">><<gs 'telefon' 'delete_sms' ERROR: FAILED TO CONVERT LITERAL: """<<telefon['SMSid']>>""">><</link>><<$telefon[''SMSstyle2'']>></TD>

-->
<<warn "CONVERSION ERROR f47ba8c6ae6f1db0bd80af1885d33ceb">>
	<!-- FAILED TO CONVERT
	</TR>'
-----
	ERROR: FAILED TO CONVERT LITERAL: """<""" / ERROR: FAILED TO CONVERT LITERAL: """TR>'"""

-->
<<warn "CONVERSION ERROR 0eefe07fed739a6b0ee6d0d33049cbab">>
<</widget>>
:: telefoncontactsms_macro[widget]
<<widget 'telefoncontactsms'>>
	<!-- !! Contact Row in phone contact list-->
	<<setinit $telefon['ContactIcon'] = $contactIcon[_args[0]]>>
	<<setinit $telefon['ContactNPCcode'] = $contact[_args[0]]>>
	<!-- !!If file extension is not given, .png is assumed-->
	<<if instr($telefon['ContactIcon'],'.') == 0>>
		<<setinit $telefon['ContactIcon'] += '.png'>>
	<</if>>
	<!-- !!If path is not given, default phone icon path is assumed-->
	<<if instr($telefon['ContactIcon'],'/') == 0>>
		<<setinit $telefon['ContactIcon'] = 'images / $system / $phone / $icons /  + $telefon['ContactIcon']>>
	<</if>>
	<<set $result = >>
	<TR>
	<TD><img src="<<$telefon[''ContactIcon'']>>" width="75"></TD>
	<TD><<<<=$npc($telefon[''ContactNPCcode'').nickname>>]>></TD>
	<TD><<link "New Message">><<gs 'telefon' 'npcSendListSms' '$telefon['ContactNPCcode']'>><</link>></TD>
	<!-- FAILED TO CONVERT
	</TR>'
-----
	ERROR: FAILED TO CONVERT LITERAL: """<""" / ERROR: FAILED TO CONVERT LITERAL: """TR>'"""

-->
<<warn "CONVERSION ERROR 0eefe07fed739a6b0ee6d0d33049cbab">>
<</widget>>
:: telefonsmsMessageToSend_macro[widget]
<<widget 'telefonsmsMessageToSend'>>
	<<setinit $telefon['ContactNPCcode'] = $SMSSendContact[_args[0]]>>
	<<set $result = >>
	<TR>
	<TD><<<<=$npc($telefon[''ContactNPCcode'').nickname>>]>></TD>
	<TD><a href="exec: gs ''telefon'', ''smsSendMessage'', ''<<ARGS[0]>>''"><<$SMSSendMessage[ARGS[0]]>></a></TD>
	<!-- FAILED TO CONVERT
	</TR>'
-----
	ERROR: FAILED TO CONVERT LITERAL: """<""" / ERROR: FAILED TO CONVERT LITERAL: """TR>'"""

-->
<<warn "CONVERSION ERROR 0eefe07fed739a6b0ee6d0d33049cbab">>
<</widget>> */
