<?xml version="1.0" encoding="utf-8"?>
<ui:TitleForm xmlns:fx="http://ns.adobe.com/mxml/2009" 
              xmlns:s="library://ns.adobe.com/flex/spark" 
              xmlns:mx="library://ns.adobe.com/flex/mx" 
              xmlns:form="com.afi.estimator.views.form.*" 
              xmlns:ui="com.afi.estimator.views.ui.*" 
              creationComplete="init()" 
              xmlns:sharewithagent="com.sharewithagent.*" 
              addedToStage="callTracking()">
    
    <fx:Script>
        <![CDATA[
            import com.afi.estimator.style.buttons.WhiteButton;
            import com.sharewithagent.ShareMain;
            import com.tracking.TrackingManager;
            private function callTracking():void{
                TrackingManager.trackOmniture("Share With An Agent");
            }
            
            import com.afi.estimator.model.TextModel;
            import com.afi.estimator.style.buttons.GreenButton;
            import com.afi.estimator.model.PagesModel;
            import com.afi.estimator.views.paging.FormScroller;
            import com.afi.estimator.views.View;
            
            import mx.managers.PopUpManager;
            
            [Bindable]private var pageName:String = 'sharePage';
            
            [Bindable]private var padding:Number = 15;
            
            private function init():void {
                if(!PagesModel.shareMain) {
                    var shareMain:ShareMain = new ShareMain();
                    PagesModel.shareMain = shareMain;
                }
                View.instance.nextprevious.currentState='prev';
                PagesModel.shareMain.api_key = root.loaderInfo.parameters.api_key;
                container.addElement(PagesModel.shareMain);
            }
            
        ]]>
    </fx:Script>
    
    <s:Label id="formTitle" text="{TextModel.get(pageName).title}" styleName="formTitle" paddingBottom="10" />
    
    <s:Group width="100%" height="100%" top="-60">
        <ui:BlueFormbackground width="100%" height="100%" />
        
        <s:VGroup paddingBottom="{padding}" paddingLeft="{padding}" paddingRight="{padding}" id="container">
        </s:VGroup>
        
    </s:Group>
    
</ui:TitleForm>