<scenario begin="paypal_account" begin-process="first_void">
    
    <screen type="Void"  id="first_void">
        
        <actions>
            <action type="Next" title="NEXT">
                <if condition="is-not-null id1">
                    <then>
                        <goto target="paypal"/>
                    </then>
                    <else>
                        <goto target="paypal_account"/>
                    </else>
                </if>
            </action>
        </actions>
    </screen>

    <screen type="group/info" title="INTRODUCETI CONTUL PayPal" id="paypal_account" sound="input_payment_indent.mp3">
        <fields>
            <text-field id="id1" keyboard="any:[en,ro,symb]:lower:true" max-len="30" title="Email" message="Insert PayPal Email Account">
				<validator type="regex">
					<rules>
						<rule regex="^[-\w.]+@([A-z0-9][-A-z0-9]+\.)+[A-z]{2,4}$"/>
					</rules>
				</validator>
			</text-field>
        </fields>
        <actions>
            <action type="Next" title="INAINTE">
                <online-request type="default" function="" params="id1">
                    <actions>
                        <action type="success">
						   <goto target="confirm"/>
                        </action>
                        <action type="error">
                            <dialog type="Info" title="Error" message="Contul nu a fost gasit" timeout="10" default="okay">
                                <actions>
                                    <action type="okay" title="OK">
                                        <cancel/>
                                    </action>                                            
                                </actions>
                            </dialog>                            
                        </action>
                        <action type="exception">
                            <dialog type="Info" title="Error" message="Nu exista conexiune cu serverul" timeout="10" default="okay">
                                <actions>
                                    <action type="okay" title="OK">
                                        <cancel/>
                                    </action>                                            
                                </actions>
                            </dialog>
                        </action>
                    </actions>
                </online-request> 
            </action>
            <action type="Prev" title="INAPOI">
                <goto target="previos"/>
            </action>
            <action type="Exit" title="MENIU">
                <goto target="exit"/>
            </action>
        </actions>
    </screen>
    
    <screen type="confirm/comunal" title="VERIFICAREA CONTULUI" id="confirm" sound="validate_phone.mp3" message="&lt;html&gt;&lt;b&gt;&lt;center&gt;&lt;br&gt;Va rugam verificati datele introduse.&lt;br&gt;&lt;br&gt;Apasati CONFIRMARE pentru a avansa.&lt;br&gt;Apasati INAPOI pentru a corecta contul.">
	<fields list="id1,disp1"/>
        <actions>
            <action type="Next" title="CONFIRMARE">
               <goto target="paypal"/>
            </action>
            <action type="Prev" title="INAPOI">
                <goto target="paypal_account"/>
            </action>
            <action type="Exit" title="MENIU">
                <goto target="exit"/>
            </action>
        </actions>
    </screen>
	
    <screen type="Void"  id="paypal">
        
        <actions>
            <action type="Next" title="NEXT">
                <if condition="is-not-null #back">
                    <then>
                        <clear keys="#back"/>
                        <goto target="paypal_account"/>
                    </then>
                    <else>
                        <set key="#back" value="1"/>
                        <modify src-key="id1" t-key-title="^(.*)$" v-key-title="Cont"/>
                        <goto target="pay"/>
                    </else>
                </if>
            </action>
        </actions>
    </screen>
	
</scenario>