<html>
	<head>
	<!-- Copyright 2013 Adobe Systems Incorporated.  All rights reserved. -->
		<title>LiveEdit Bridging</title>
		<script type="text/javascript" src= "Constants.js"> </script>
		<script type="text/javascript" src= "LiveEditBridging/GenericLiveEditBridger.js"> </script>
		<script type="text/javascript" src= "LiveEditBridging/TextHudLiveViewBridger.js"> </script>
        <script type="text/javascript" src= "LiveEditBridging/ExtensionsBridgeFunctions.js"> </script>
        <script type="text/javascript" src= "LiveEditBridging/SelectionSyncBridger.js"> </script>
		<script type="text/javascript" src= "Extensions/Utils/FluidGridUtility.js"> </script>
		<script type="text/javascript" src= "LiveEditBridging/LiveEditBridgingObject.js"> </script>
        <script type="text/javascript" src= "LiveEditBridging/SelectorHudBridger.js"> </script>
        <script type="text/javascript" src= "LiveEditBridging/DevicePreviewBridger.js"> </script>
        
        <script type="text/javascript" src="../Common/Scripts/StyleSheet.js"></script>
        <script type="text/javascript" src="../CssGrids/StyleSheetManager.js"></script>
        <script type="text/javascript" src="../Common/Scripts/dwscripts.js"></script>
        
		<script type="text/javascript">
            var gCurrentDocumentDOM = undefined;
            
            function isDOMRequired()
            {
                return false;
            }
            
            function receiveArguments(docDOM)
            {
                //this is the DOM of the document for the command to work with
                gCurrentDocumentDOM = docDOM;
            }
			/*
				Entry point for the live editing feature.
			*/
			function initLiveEdit()
			{
                //check whether any DOM has been passed
                var documentDOM = gCurrentDocumentDOM;
                //if we didnt get a DOM, use the current document DOM
                if(!documentDOM)
                {
                    //try to get the parent document dom since this might be a related doc dom
                    //if we do not get a parent dom, then we are on an HTML document dom
                    documentDOM = dw.getParentDocumentDom();
                    if(!documentDOM)
                        documentDOM = dw.getDocumentDOM();
                }
                if(documentDOM)
                {
                    var browser = documentDOM.browser;
                    //if it is a FG doc, then browser is not part of DOM.
                    //get the last set browser
                    if (documentDOM.isFluidGridDoc()) 
                    {
                        browser = dw.getBrowser();
                    }
                    if (browser) 
                    {
                       var browserWindow = browser.getWindow();
                       if (browserWindow) 
                       {
                            //do not initialize if it is already initialized
                            if(typeof browserWindow.isDwLeInitialized == "undefined" || browserWindow.isDwLeInitialized == null)
                            {
                                var liveEditObj = new LiveEditBridgingObject(browser, documentDOM, documentDOM.isFluidGridDoc());
                                liveEditObj.attachConstantsToBrowser();
                                liveEditObj.attachDwFunctions();
                                liveEditObj.evaluateLiveEditJS();
                            }
                       }
                    }
                }
			}
		</script>
	</head>

	<body onLoad="initLiveEdit();">
	</body>
</html>

