<?xml version="1.0" encoding="utf-8"?>
<s:Group 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:pages="com.afi.estimator.views.pages.*" 
         xmlns:ui="com.afi.estimator.views.ui.*" accessibilityEnabled="false"
         width="1024" height="100">
    
    <s:HGroup width="1024" height="100" horizontalAlign="right" paddingRight="80" paddingTop="25" gap="20" creationComplete="init()">
                    
        <fx:Script><![CDATA[
            import com.afi.estimator.model.TextModel;
            import com.afi.estimator.views.pages.*;
            import com.tracking.TrackingManager;
            
            import mx.core.UIComponent;
            import mx.managers.PopUpManager;
            import mx.printing.FlexPrintJob;
            import mx.printing.FlexPrintJobScaleType;
    
            [Bindable]public var pageName:String = "header";
            
            [Bindable]public var printVisibility:Boolean;
    
            private function faq():void {
                var win:FaqPopup = PopUpManager.createPopUp(this, FaqPopup, true) as FaqPopup;
                PopUpManager.centerPopUp(win);
                win.y = 100;
                TrackingManager.trackOmniture("FAQ");
            }
    
            private function glossary():void {
                var win:GlossaryPopup = PopUpManager.createPopUp(this, GlossaryPopup, true) as GlossaryPopup;
                PopUpManager.centerPopUp(win);
                win.y = 100;
                TrackingManager.trackOmniture("Glossary");
            }
            
            private function init():void {
            }
            
            public function printRes():void {
                //var pp:PrintPag = new PrintPage();
                var printJob:FlexPrintJob = new FlexPrintJob();
                printJob.start();
                printJob.addObject(UIComponent(this.parentApplication), FlexPrintJobScaleType.MATCH_WIDTH);
                printJob.send();
            }
            
        ]]></fx:Script>
        
        <s:Button accessibilityEnabled="false" tabEnabled="false" label="{TextModel.get(pageName).print}" id="print_btn" skinClass="com.afi.estimator.style.buttons.TextButton" buttonMode="true" visible="{printVisibility}" click="printRes()"/>    
        <s:Button accessibilityEnabled="false" tabEnabled="false" accessibilityName="FAQ" id="faq_butotn" click="faq()" label="{TextModel.get(pageName).faq}" skinClass="com.afi.estimator.style.buttons.TextButton" buttonMode="true"/>
        <s:Button accessibilityEnabled="false" tabEnabled="false" accessibilityName="Glossary" label="{TextModel.get(pageName).gloss}" click="glossary()" skinClass="com.afi.estimator.style.buttons.TextButton" buttonMode="true" />
        <!--<s:Button accessibilityEnabled="false" tabEnabled="false" label="{TextModel.get(pageName).share}" click="toggleShare()" id="share_btn" skinClass="com.afi.estimator.style.buttons.TextButton" buttonMode="true" />-->
    </s:HGroup>
    
    <!-- not necessary as there is no share-->
    <!--<ui:SharingBar accessibilityEnabled="false" alpha="0" visible="false" id="share_bar" x="{share_btn.x+10}" y="{share_btn.y + share_btn.height}" />-->
    
</s:Group>